I have a tank turret connected to the hull by a Servo type hinge constraint, and im trying to figure out how to set the Hinge Constraint’s Target Angle by the position of the mouse relative to its 3D location in the world.
anyone have any leads to how i can accomplish this?
You can get the mouse position in the worldspace with the following.
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local mousePos = mouse.Hit --cframe value describing mouse position
local mousePos2 = mouse.Hit.Position --vector3 value describing mouse position
pardon me for not getting it, but how would i apply this in my situation? I tried reading up on other examples, but havent found something that helped me understand