Any Way To Move A Vehicle With Mouse Movement

Currently, when a player is in a VehicleSeat, movement is controlled using the WASD keys. Is there anyway that I can use the mouse to control the steering instead? For example, if I right click and drag to the right, I would like the vehicle to steer right. If I right click and drag left, I would like the vehicle to steer left. In other words, I would like to control it with the mouse, just like controlling a character.

Or, alternatively, maybe something like this can be done without using a VehicleSeat?

1 Like

Just manually set the steer property to the direction you want
left = -1
right = 1
straight = 0

and yah there are like 5 other ways off the top of my head you could do this but vehicle seat is a good place to start learning.

Not sure I am following - maybe some sample code would help. I would like to steer the vehicle with the mouse instead of the WASD keys. For example, for an airplane, I would like to use the mouse to steer the plane (left, right, up, down) instead of using keys.

Get the mouse x and y positions (in pixels)
get the players screen size in pixels

2*mousex/screenx -1 is the equivalent to steer
2*mousey/screeny-1 is equivalent to throttle
1 Like