Heya DevForum, so for the past two days I’ve been working on my glider model, trying to get somewhat of a decent gliding mechanics down not too realistic but just right for gameplay and I’m trying to setup the controls of my glider model but when applying rotations via fromeulerAnglesXYZ to the model’s primary part it seems to prevent gravity from affecting my Glider, which is one of the driving forces behind gliding.
Take a look
https://gyazo.com/af53e703e6d7611f81ac63bd73d85002
Here’s the code main code behind applying the rotations:
local roll = _horizontal.Value/10
local tilt = _vertical.Value/10
local yaw = 0
--yaw/turn our model based on the roll
local yaw_angle = root.CFrame.RightVector:Dot(Vector3.new(0, 1, 0))
yaw = yaw - yaw_angle
--stall prevention
if (root.CFrame.LookVector + root.Velocity.Unit).Magnitude < 1.4 then
tilt = tilt + 0.3
end
--apply our rotation values to model
if tilt ~= 0 then
root.CFrame = root.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(-tilt), 0, 0)
end
if roll ~= 0 then
root.CFrame = root.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(roll))
end
if yaw ~= 0 then
root.CFrame = root.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(yaw), 0)
end
now I’m not sure why this is the case but I’ve linked a place file for you guys to have a look, all the code is in the Controller local script located in StarterPlayerScripts:
Unfinished_Glider.rbxl (51.7 KB)
EDIT: Yes the model is unanchored