Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curvy 2.5D Platformer - Detaching from Spline when Jumping
#3
Having worked on my idea of modifying the Endless runner script to enable me to detach at the end of splines, I abandonded that approach as it wasn't performing as I wanted and the code was becoming convoluted.

So I went back to basics and cretaed a new rigibody based approach which allowed me to have a player object following splines as a guide/rail while under the control of the Unity physics system and thus able to jump and disconnect/reconnect to the spline paths at will.

However I'm encountering an odd issue when I try to have the player object follow a sloped curve i.e. a curvy spline where the control points curve up or down in the Y axis, the rigidbody/player follows the curve of the spline fine but it is dragged towards the first control point without any user input. And if you try to move away from the first control point, it feels as if the rigidbody is connected by a rubber band to that control point, in other words you can only move so far before the rigidbody slows and struggles to move any furhter away from the first control point.

If I disable the curvy spline components being used as a guide/rail under slope, then the rigidbody behaves as expected i.e. it can freely move along the curved surface. I therefore suspect that my issue is arising from how I am setting the position of the rigidbody on the slope using the curvy spline guide. At present, the rigidbody script adopts the approach of the endless runner script and casts a ray downwards to detect a collider attached the the curvy spline. It then uses the InterpolateFast method to get the X and Z position for the the current TF of the spline and applies these to the rigidbody, with the Y position taken from the rigidbody to enable it to stay on the surface of the slope.

However I'm at a loss as to where I'm going wrong so any advice/suggestions would be appreciated.
 

 
Reply


Messages In This Thread

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 10 04-03-2024, 03:16 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_

Forum Jump: