why normalized not work for vector3?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bgegg

this is code.

func _process(delta):
	Vector3(1,0,1).normalized() * delta

this is result.

(0.011783, 0, 0.011783)

Why doesn’t it become an integer?
normalize is used for the whole vector3.

:bust_in_silhouette: Reply From: kidscancode

normalized() makes the length of the vector 1. Your vector normalized is (0.7071, 0, 0.7071), which has a length of 1 and then you multiply by delta, which is approximately 0.0167. There is nothing wrong here.

thanks,i understand this.

bgegg | 2019-08-22 01:01