#Operators (Vector3,Float,Double)
1 messages · Page 1 of 1 (latest)
I'm not sure my entire last message sent but in general hello 🙂 im getting an issue when following a tutorial where the** *error CS0019: Operator '' cannot be applied to operands of type 'Vector3' and 'double' i have read a few forums where people discuss that it is not possible to do this but I cannot seem to find a workaround, any advice or input would be hugely appreciated.
Maybe you can send the line the error comes from. This would really help understand your problem more
Hey Desaw 🙂 "Vector3 movement = this.transform.forward * verticleAxis + this.transform.right + horizontalAxis;" - this is thhe guy
Okay is "verticleAxis" an float?
yes it is, referenced 2 lines before
Vector3 movement = this.transform.forward * verticleAxis + this.transform.right * horizontalAxis;
Did you want to write this?
You maybe accidentally added up transform.right with horizontalAxis expect multipling it
let me double check that!
I dont know if this is what you wanted to do
im trying to make a move function
i have two floats vertical and horizontal
I use Input.GetAxis to retrieve these
then i want to create a vector called movement but in this line it says i cannot use operators such as *
Mhm
what should the movement vector say
like where its going?
it goes to an animation controller i setup , both going to the vertical and horizontal axi of that component
i hope that makes sense
Vector3 movement = this.transform.forward * Input.GetAxis("Horizontal") + this.transform.right * Input.GetAxis("Vertical");
works perfectly for me
no errors
so for a blend tree?
yeah thats the one!
i tried out your code, and it got rid of my error with some small exceptions
must not have liked me declaring it outside of the vector
so does everything work now?