trouble with gravity, please help me!!

hi guys!

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!

so any ideas?

I have no clue, and plus I am not good in codes!

please!!! help me!!

thanks!

37 minutes…

no ideas! no help!:frowning:

raycast down and transform gravity vector to the normal of the surface you hit.

Hehe…the forums move fast, but they don’t always move that fast :wink:

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.

You’ll need to make a ton of special zones if you want loops, but the planet style is pretty easy.

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!

thanks again!

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.

JRavey the game it is not walking on a planet surface…is like a race in frist person, and part of this race there is this kind of looping .

Every things are ready but just missing this main point of the game for me, because it a very simple mechanics, but it driving me crazy!

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.

I didnt want to give up, i already tried all the codes i ve seen about it but it doesnt work!, i ll check what Jravey said.

the graphics are sooooo nice! prefessional thing, but the script jesusssss How I would love to know about programing a another level!

and all so a have to bear the jokes…programming ist not for girls! hehehheheh

I need the code, if u guys find anything send me! PLEASEEEEEEEE.

IAM KIND OF PERSON WHO DOESNT GIVE UP TILL A GET IT!

CHEERS!!

iam here studying thsi gravity thing! hehehheh

oooh cameron !!!

come on, PUSH IN YOU MIND this code i am sure u ll get it! heheh

please!

Oh, that is clever if the track is accommodating, Cameron. Rotate it appropriately, give it a local gravity and you’re set.