I’m trying to create a side-scrolling game where the character and screen are constantly moving to the right, so the stage is coming from the right to left, and the player just jumps and avoids obstacles. How would I go about doing this?
I’m pretty new at unity, I’ve only made very simple first person perspective stuff, so I could really use some help.
Hi.
Attach this to your Camera:
var Player:Transform
function Update () {
transform.position.x=Player.transform.position.x;
}
If you click on the camera and look at the inspector,
search the this script-Component. It says “None(Transform)” somwere.
Now put your Player-Object (The Object the Camera should follow) per drag and drop
onto that “None(Transform)”. It should change to: “TheNameOfYourObject(Transform)”.
If it doesnt work fine, change all x in the script to z. If it still doesn
t work, please resonse. Hope this helps you =)