Answer the question
In order to leave comments, you need to log in
How to write the transform.position.x value to a variable?
I need to write the value of transform.position.x into a variable
Question, how to do this?
void Update(){
//doesn't work, throws an error(
private Transform = transform.position.x;
}
Answer the question
In order to leave comments, you need to log in
Because you need to learn seasharp and not use access modifiers inside methods.
Well, you've been kicked by previous speakers, so I'll just add an answer:
transform.position.x is a float variable. Hence
private float PoseX = transform.position.x;
will do what you need.
And of course, do not write access to variables inside the void))) remove private
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question