Best way to drive around in a tube

Hi, I’m fairly new to Unity so I could really use some help in figuring out this problem!

Basically Im making a small game similar to the bonus stage in Sonic 2. This video will give a clear explanation if you dont know what I’m talking about:

The only difference is that in my game its a full tube instead of a half, and well, yes a spaceship instead of Sonic.

So…
I’m having trouble figuring out the best way to make the spaceship being able to drive around in the tube, upp the wall, the cieling etc. What do you think would be the best way to do this?

Curved edges, and instead of gravity being based on world values, base it on your transforms values.

That basically means to “attach” it to the tunnel level?

Perhaps using raycasting I can check where the ship is and then rotate it accordingly to the size of the tunnel?

Have you found a solution to this?

I am doing a similar thing

Well, you can either alter gravity for that object (apply a constant force in the directly of the wall)…

Or turn the entire tube and keep the gravity the same.

I’m unsure why a spaceship would be experiencing gravity, though. Or would ‘drive up a tube’.

Math…

ship.transform.up = physics.raycast.hit.normal

Move left, and redo that and the ship will hug the tunnel. :wink:

maybe Orobu is talking about Gyruss style space shooter?