#well it can t convert a float to a
1 messages · Page 1 of 1 (latest)
by not trying to pass a float to a vector3 variable
its from lerp itself cannot change that
You computed smoothPosition for nothing here, did you mean to use that, instead of smoothSpeed on that last line?
transform.position = smoothPosition;
That would make more sense in this context
you do understand why the error was showing up previously though?
do you mind explaining me?
c# is a strongly typed language, you can search more regarding that term to understand better. But as a summary, you can't assign to variables, values that are not of the same type of the variable. In this case, a vector3 variable will only accept vector3 values. There's a thing called casting though, that "bypasses" this, which you can also read more about it to understand properly.
tysm so since i did this i casted the vectror 3?
no, because you're directly assigning a value of the same type, cast would be something like passing a vector3 to a vector2, not the same types, but similar enough that it can be used almost interchangeably in some cases.