I’m trying to make my object move to the starting position once it has gone past a certain co-ordinate but it just keeps erroring up. Here is my code:
if(transform.position.x < -161.0f)
{
print ("Enemy hit the end of the map!");
transform.position.x = -77.59406f;
}
error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.position’.
And the error. What am I doing wrong?
Thanks, Nick.