- Home /
making camera keep moving right
Hello guys,im making a 2d platformer game where u just jump on platforms and now im using a script which just tracks the player.
I need a script where the camera keeps moving right regardless of where the player is and when the player is out of sight it makes game over.(i already made the out of sight part. 1.I tried making my own scipt but I have no luck since i dont know much scipting. 2.looking at all youtube platformer videos but no luck. 3.Searching on unity anwsers and webpages
If anybody knows how to do this can please give me some help.thanks
Answer by sabdekhen · Dec 11, 2018 at 04:13 PM
You should add * sign between them like following:
private int movingSpeed = 10f;
void Update()
{
transform.position += Vector3.right * Time.deltaTime * movingSpeed;
{
Answer by DrunkFish01 · May 25, 2014 at 01:54 PM
var speed : int = 2;
function Update () { transform.position += Vector3.right Time.deltaTime speed; }
This will make the gameobject going right just attach the script to the camera and change the speed to what ever you like.
Answer by Albert-han · Jun 05, 2014 at 02:42 PM
Sorry i replied so late i had an exam but when i inserted this code it said insert a semicolon at the end and when i add i receive more errors.