Hello, I'm trying to make my moving platform with this code:
But the output say's I cannot modify the return value of "UnityEngine.Transform.position" and that I cannot change a float to a bool. Any suggestions?Code:using System.Collections; public class testfloater:MonoBehaviour { public float Speed = 0.2F; public float stopper = 50.0F; public float header = 0.0F; // Use this for initialization void Start () { } // Update is called once per frame void Update () { float moveInput = Time.deltaTime * Speed; transform.position += new Vector3(moveInput, 0, 0); if (transform.position.x = stopper) { float inverseInput = Time.deltaTime * Speed * -1.0F; transform.position += new Vector3(inverseInput, 0, 0); } if (transform.position.x = header) { transform.position += new Vector3(moveInput, 0, 0); } } }

Register
Events
Popular
More
Post #1




Dumb x 15
Agree x 3
Programming King x 1
Funny x 1
Useful x 1
Friendly x 5







