What I am asking, is how do you disable vertical aiming, but keeping horizontal aiming?
This isn't very precise mathematically. Let's make it so.
More or less, this means whatever we are doing, the y
portion of the "aim" is ignored. For example, if the "aim" is the mouse's position in 3D space, then we just ignore its y
position.
If it's displacement, again, just ignore the y
; if it's a direction, again, ignore the y
.
A simple way to "ignore the y
" is to multiply it out to be 0:
dir = Vector3.new(0.4, 0.5, 0.3) print( dir * Vector3.new(1, 0, 1) ) -- (0.4, 0, 0.3)
That turns the direction into something flat in the plane -- so it will ignore how much up-and-down there is, but still keep the other senses of direction.