Quantcast
Channel: Answers by "IvovdMarel"
Viewing all articles
Browse latest Browse all 145

Answer by IvovdMarel

$
0
0
The error you are receiving also explains how to fix it (although I understand why it is not obvious when you read it). Consider to store it in a temporary variable: Vector3 pos = transform.position; pos.y = 0; transform.position = pos; This is because the position variable has a getter and a setter, which means it can only be modified as a whole, but not partially. The best place for this code would be FixedUpdate though, not Update (since FixedUpdate is not framerate dependent).

Viewing all articles
Browse latest Browse all 145

Trending Articles



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