I have this error and another error: ERROR CS1612 cannot modify a value type return value of UnityEngine.Transform.position consider storing the value in a temporary variable.
Code: using UnityEngine;
using System.Collections;
public class SwimmingScript : MonoBehaviour
{
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
if (this.transform.position.y < -1.4)
{
this.gameObject.transform.position.y = new Vector3(transform.position.x, -1.4f, transform.position.z, -1.4f);
}
}
}
I really need help :(
↧