#How To Lock The Z Axis in 3D???

15 messages · Page 1 of 1 (latest)

low pebble
#

so im wanting to lock the z axis on the gun which follows the mouse so that the gun wont look towards the camera im not sure how to fix this

jovial bronze
low pebble
jovial bronze
#

Sorry I completely forgot about this

#

Im at work, I cant download that video I'll check it out when I get home

jovial bronze
#

So gun_to_mouse just returns an empty vector3

#

None of the code in your script actually does anything

low pebble
jovial bronze
#

look at the mouse, but only the mouses x,y coordinates and make the z value the value of the guns origin

#

global_position.origin.z

#

I think thatd be a good place to start

low pebble
low pebble
#

im apparently terrible at working with vectors trying to figure out how to use vector 2 in 3d😅

low pebble
#

i did try something that did kinda work but the issue is the rotation point is towards that top left of the view port rather then the center of the player