Hello, I'm trying to make an application where when I press the right arrow I move the camera toward a predefine position. I tried with this code but it don't work. Code (CSharp): using UnityEngine; using System.Collections; public class MovePOV : MonoBehavior { public Vector3 initialPosition; public Vector3 modifPosition ; void Start ( ) { transform. position = initialPosition; } void Update ( ) { if (Input.GetKeyDown (Keycode.RightArrow)) transform.position = modifPosition; } } I searched solutions on the Web and I did't find what I needed. Does someone can explain me why this code don't work for what I want to do. Thanks.
Looks right to me, assuming you want the whatever this script is attached to to jump to modifPosition when the right arrow is pressed. In what way does it not work?
You're right. This script work properly when I use it alone. I forgot to specify that i'm using a custom package where I use an Oculus. So I think the problem come from it. I Will check about. Thanks you for your answer and sorry for didn't check the script alone before