Please help me to make a scrollable function.

jimmmmjimmmm Member Posts: 12

Hi guys. I’ve been trying to make a scroll the map up and down function for 1 month and still haven’t find any solutions yet. I only succeeded to make scroll function that I can scroll the map up and down. but I still haven’t figured out why every times I scroll the map up and down, the black space appears. I guess the black space is the scene background. Are there any solutions to not shows the black space when I scroll the map? Thanks.


Comments

  • bob loblawbob loblaw Member, PRO Posts: 793

    in that case you probably need to constrain the min/max values of how far it can move, but use a camera that moves, not the image.

    this is a quick demo with universal camera size adjustments. it only scrolls on the y axis, but if you want to move across x, you use the same logic, but changed for x/width values.

    the actors used need to be unlocked though. If I can find the video tute I used to learn this, I'll let you know. can't seem to find it on YouTube right now.


  • jimmmmjimmmm Member Posts: 12

    Thank you for helping me!

  • jimmmmjimmmm Member Posts: 12
    edited April 2021


  • jimmmmjimmmm Member Posts: 12
    edited April 2021

    May I ask you a one more question? You said I need to constrain min/max value of how it can move, but I’m not really sure how to do it because I literally don’t know anything about coding. Do I need to change number of min/max in this picture? I’m not really sure what’s the meaning of the numbers in min/max constrain attribute block.


  • bob loblawbob loblaw Member, PRO Posts: 793
    edited April 2021

    so those relate to the scene height, and camera size.

    the bottom coordinate of the scene is 0. the top is 3000 (i think is what i set the scene size as). the camera height is 768. so those constrain behaviours stop the camera from reaching the full top and bottom of the scene. i set the bottom to half the camera height from the bottom, and top to less than the scene height (i was too lazy to do the maths for 3000-(cameraHeight/2)). that value doesn’t need to be exact, as long as the max position is less than half the camera size less than the scene height.

    if you were creating logic for horizontal movement as well, you’d constrain the x min to half the camera width, and constrain x max to the scene width- half the camera width.

    i hope that’s making sense. really wish i could find the video that taught me.

  • jimmmmjimmmm Member Posts: 12

    Thanks! It helped me a lot!

Sign In or Register to comment.