#well it can t convert a float to a

1 messages · Page 1 of 1 (latest)

hard elm
#

how cloud i fix it>

arctic copper
#

by not trying to pass a float to a vector3 variable

hard elm
#

its from lerp itself cannot change that

north root
#

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

hard elm
#

it worked

#

did this

north root
#

That's a simplification yep

#

Gets rid of the variable

arctic copper
hard elm
#

not relly

#

bc i used floats

hard elm
arctic copper
# hard elm 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.

hard elm
#

tysm so since i did this i casted the vectror 3?

arctic copper
#

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.

hard elm
#

kinda understod

#

also

#

can i put a texture

#

not the col,or

#

color?