Vehicles on Walls
by Tom O'Neill · in Torque Game Engine · 09/21/2005 (12:12 am) · 6 replies
Some friends and I are writing a game where vehicles can travel on walls and ceilings, not just the ground or buildings.
Does anyone have any suggestions on how to accomplish this?
Thanks so much,
Tom O'Neill
Does anyone have any suggestions on how to accomplish this?
Thanks so much,
Tom O'Neill
About the author
#2
09/21/2005 (1:20 pm)
Problem with disabling gravity for vehicles is you would not have anything to keep your tires on the ground and no traction, to do walls and ceilings I would think would require somehow setting the gravity point to below the car wherever the car may be which wouldn't be a easy task.
#3
09/21/2005 (3:55 pm)
What about removing gravity from the world and applying downward force on the vehicle at all times - that should keep it stuck to some surface. So what's the easiest way to mount a thruster on the buggy? :)
#4
Create a new vehicle class that isn't effected by gravity.
During the onWall state, get the id of the wall it is on (each wall would need to be it's own object). Have a force pulling towards the axis you want to keep it on the wall. When in the inAir state, activate gravity again.
I would be interested in how you get this to work, as it would be cool for a fuchikoma type vehicle.
09/21/2005 (4:49 pm)
An idea would be to have several states for the vehicle. Such as onWall, onCeiling, onGround, inAir... Create a new vehicle class that isn't effected by gravity.
During the onWall state, get the id of the wall it is on (each wall would need to be it's own object). Have a force pulling towards the axis you want to keep it on the wall. When in the inAir state, activate gravity again.
I would be interested in how you get this to work, as it would be cool for a fuchikoma type vehicle.
#5
It was kind of funny when I went into the big hut with this vehicle from the starter.fps mod. I could actually move around on the ceiling with it.
Good luck,
Frank
09/21/2005 (9:27 pm)
I built a vehicle like this a while back accidentally. What I did was modify the hover vehicle to disable gravity when within a certain distance of a surface. Then I put it code that would cause the vehicle to stay a certain distance from the surface. I do not think I was using forces. Also, you may want to put an exception in there if you get a big impulse it can break free of the attraction to surfaces. I was using ray casts to determine distance. I used the hover vehicle as a base to hack. It has some good examples of using forces to move around and turn. It also has good spring force examples. You may even be able to use the spring force to attract the vehicle to the surface. If the spring gets to much tension it would move away from the surface. I am not sure exactly how that would work, but it may be a good place to start. I don't have any code to hand you unfortunately as this vehicle was an intermediate step in some experiments I was performing at the time. However, this should give you some ideas that will help you keep the physics working with your vehicle.It was kind of funny when I went into the big hut with this vehicle from the starter.fps mod. I could actually move around on the ceiling with it.
Good luck,
Frank
#6
09/22/2005 (2:53 pm)
There is another thread on this, it has a good awnser. I cant remember the title of thread though so I cant find it.
Torque Owner arda