Hello Robloxians! I am making a zipline for my game, and I want to have this effect where the player tilts in the direction they are going.
e.g.
How am I able to achieve this effect?
Hello Robloxians! I am making a zipline for my game, and I want to have this effect where the player tilts in the direction they are going.
e.g.
How am I able to achieve this effect?
Weld the Character’s body part to the zipline and when a userinput is done i.e WASD, increment or decrement the specified coordinate value.
Example:
if Input.KeyCode == Enum.KeyCode.W then
CFrame += CFrame.new(0,4,0)
elseif KeyCode == S then
CFrame += CFrame.new(4,0,0)
end
There are multiple ways you could do this,
(since the rope is made up of segments) in the loop that cframes your character along the zipline you could check the angle in comparison to the segment you are currently on and use the inverse of that angle to rotate your character about the segment’s center
The process is automatic, no buttons are needed
Can you give an example please?
Lets say that the zipline is made of 500 segments (I’m not sure how to make them [I’m not a builder]).
You could run a loop through the parts (in order) and tween / CFrame (whatever system you find is best) the player along the wire.
Once you can get the offset (meaning that the hand of the player is that rotation center of the player while on the zipline) you can try to make the rotation.
For the rotation you could alter that offset by rotating.
You can access the segment that the player will be on after the current segment and check the angles between them. Using that angle (lets say its a 5 degree angle on the x axis) then you could inverse that angle and apply it to the offset.
Its hard to know unless you try to make the system yourself (I don’t know if this would work for sure)
Hope this helped!
To CFrame it, I wouldn’t CFrame the character - but instead CFrame an invisible part with an attachment. Then script it to follow your zipline using physics constraints like AlignOrientation and AlignPosition attached to the character HumanoidRoot part, but you’ll also need to set the Humanoid state to “physics” so that the internal built in physics won’t interfere. I’d also do a custom animation for the player character, to be used - otherwise I believe the character will appear to be in some fall state, or be straight as a board. LOL. I have to experiment with it myself, but I have done some custom physics stuff with character models in the past and everything I’m sharing here is just off the top of my head - the methods I used.
The reason why I wanted to use CFrame is because that’s now my zipline script works, rewriting it would be a hassle.
you could use the segements and when you tilt those segments in a certain direction script it where the player also tilts with the segement