- Home /
Spline Work-Around. Joints?
Ok, I don't really feel comfortable using someone else's code that I don't understand, due partially to my pride and stubbornness, so I was looking for a work around using joints. I'm trying to make a 2.5D platformer and there really aren't going to be a lot of twists and turns to really justify me buying someone's spline toolset anyway.
This is how I was hoping to do it. Set up a collider over an area where the player or enemy would turn and as soon as either entered the area they would hinge around a designated point so they would rotate around the turn ( was also hoping to use this for a spiral stair case. ). Is there a way to do this for just the rotation, I was wanting the character to be able to jump while turning around these corners and while ascending the spiral staircase?
All feedback is welcome. I'm fairly new so this may very well be a bad idea. I was only going to have a few turns or so per level so something small like this is what I was looking for. Any tutorials I was looking for the spline method turned out to just be advertisements for tool sets so if anyone know one I'd be happy to check it out. Thanks in advanced for all your help
PS. I'm really just looking for some direction at this point, not asking anyone to code this for me.
PPS. Using a rigid body controller
How are you moving your character: Character Controller, Rigidbody, direct manipulation of the Transform?
I gave your problem some thought. There are several approaches, but no easy solutions and no clear winners. $$anonymous$$ore details might help.
Does the object always approach the pivot at 1) exactly the same angle, 2) approximately the same angle, 3) arbitrary angle.
Is the 'release' from the pivot always a multiple of 90 degrees?
Is the player walking around arbitrarily or is the user walking a set path. If a set path, is a waypoint solution a good way to go (possibility with some latitude)?
Are the corners bi-directional.
Is this a 3D game? In particular if the player is walking a spiral staircase, is he also ascending/descending?
Why use this kind of mechanism at all? Why not create geometry and just allow the user to navigate through the turns?
this is what I am basically trying to achieve: http://answers.unity3d.com/questions/29873/Restrict-a-players-movement-to-a-path-for-a-25D-game-that-has-curved-paths.html
I agree with the spirit of the posters at the question you reference. A path of some sort is a good solution. Your idea would get very ugly very fast as a solution to this problem. Note you don't really need spline code (though it might make movement a bit smoother). Just use a series of waypoints. There are lots of posts here on UA with code to move along a series of waypoints, and the code is not very complicated. I think you can use the iTween path editor to create the waypoints even if you don't use iTween to walk the points. This would make building the path much easier:
http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/
Your answer
![](https://koobas.hobune.stream/wayback/20220613115104im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Convert Input Field to String 0 Answers
A few questions here regarding AI 2 Answers
Idle Randomiser 1 Answer
Leveling system 1 Answer
Conflicts with colliders 0 Answers