Quantcast
Channel: Questions in topic: "temporary"
Viewing all articles
Browse latest Browse all 97

Cannot modify a value type return value of `UnityEngine.Transform.localPosition'. Consider storing the value in a temporary variable. HELP

$
0
0
I was following along a tutorial on Youtube but it was written in JS but i translated it to C# but i get that error. Here is my code: headBobStepCounter += Vector3.Distance(parentLastPos, transform.parent.position) * headBobSpeed; transform.localPosition.x = Mathf.Sin(headBobStepCounter) * headBobAmountX; transform.localPosition.y = (Mathf.Cos(headBobStepCounter * 2) * headBobAmountY) + (transform.parent.localScale.y * eyeHeightRatio) - (transform.parent.localScale.y / 2);

Viewing all articles
Browse latest Browse all 97


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>