well I m working in a game, its like a race in frist person.
But now I have a problem, I want to run in a loop, or kind of roller coaster , mario galaxy…
I had seen some codes here and i ve tried but it doesnt work because when start to go up it fall out! so at moment a have any code!
Hehe…the forums move fast, but they don’t always move that fast
Anyway, in addition to Cameron’s suggestion, I’d suggest searching the forums and Unity Answers for ‘mario galaxy’, as this topic is discussed fairly frequently.
jesse I ve tried the Mario galaxy one and many other codes, but all of them, when the frist person move to go up and spin like roller coaster it fall out!
and another thing I m studying Unity less than one month!
and before this i know 0 of programming (honestly)
my thing is graphics…But I would like so much to solve it !
so i try different codes and it doesn t work, and i dont know why!
When you are in a loop, you are pushed away from the center of it, right? So you’d probably reverse gravity and push away from the center and align the character to point at the middle.
I made a hover car racing game prototype that could handle loops without needing “special zones”. Took a few days of code massaging but ended up with something very similar to f-zero like mechanics.
No clue where that project is now though, that was a few years ago, but a single raycast down to align the gravity to the surface normal worked well. From memory I was smoothing the gravity vector over time and had limits on how much the surface normal could change before I’d start to align with it. I think I also had to transform some of the velocity to keep everything stable.