How to align a player to a path while having it run on its own

Similar to Sonic the Hedgehog in the 3D era. I’m trying to create automation, a.k.a fake physics.

  ~ So basically when you step on the path, the character will run, and align to the orientation of the part. But as you can see I'm having issues, I'm currently using a Cframe Look At, but I'm asking for another method for this?

The system seems to work fine, what I’m thinking could be the issue is the way you rotated some segments of the ramp, which could be why your player faces the wrong direction.

The script basically function like this

	local BV = Instance.new("BodyVelocity", HRP)
	local objectSpace = CFrame.new(0, part.speed.Value, 0)
	BV.MaxForce = Vector3.new(100000000, 100000000, 100000000)
	BV.P = 6000
	H.CFrame = CFrame.new(
			H.Position,
			H.Position + Vector3.new(part.CFrame:toWorldSpace(objectSpace).X - part.Position.X, part.CFrame:toWorldSpace(objectSpace).Y - part.Position.Y, part.CFrame:toWorldSpace(objectSpace).Z - part.Position.Z)
	)
	local objectSpace = CFrame.new(0, part.speed.Value, 0)
	BV.Velocity = Vector3.new(part.CFrame:toWorldSpace(objectSpace).X - part.Position.X, part.CFrame:toWorldSpace(objectSpace).Y - part.Position.Y, part.CFrame:toWorldSpace(objectSpace).Z - part.Position.Z)

If you face the parts of the ramp themselves inward, it will look much better. Another option is to tween the cframe from the last one so it does not look like a glitchy jump.

EgoMoose made a custom character controller for things like this, here.

4 Likes