CFrame.fromeulerAnglesXYZ breaks Glider physics

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

1 Like

I think the problem is with network ownership. I didn’t test it too much, but once I set it for the local player it did fall, but not much else. The server determines the physics so the client just thinks it’s floating there.

The reason gravity no longer effects your glider after setting its Cframe is because setting the CFrame of a object stops and resets its physics. It has nothing to do with network ownership.

The only way I can think of to fix this is create your own gravity system and incorporate it into the CFrame application.

1 Like

Ah damn, that sucks but alright thanks I’ll have to use a bodymover or something because If I use my own gravity system I’d have to create collision as well to prevent the object from phasing through others.