Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

C# transform position

$
0
0
transform.position.x =Mathf.Clamp(transform.position.x, minPosX, maxPosX); transform.position.z =Mathf.Clamp(transform.position.z, minPosZ, maxPosZ); Hi, I have these lines in my code and here's an **error**: error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.position'. Consider storing the value in a temporary variable This script is for panning on Android. Someone said that it's impossible to modify single parameter in C# and you need to convert it into some temporary variable, but I don't know what to do with "Mathf.Clamp" and the whole line. Help please

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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