Make creatures walk on the wall

hevi

28-02-2008 22:17:04

Hi everyone,
I am working on a game and I have some creatures in my game and I want them to walk on walls. The creatures are cubes in physics world and they have a mass as well as I have a gravity in the scene.
I have an idea to apply an anti-gravity force on them but that may cause lotz of other problems in the game..

Any ideas please?

betajaen

28-02-2008 22:24:35

Not if you apply that gravity force to the actors that need to be on the wall.

hevi

28-02-2008 22:40:44

Not if you apply that gravity force to the actors that need to be on the wall.

so no way with the gravity, right?

betajaen

28-02-2008 23:36:06

No gravity is a constant that effects all of the actors in the scene (unless you raise a flag to ignore it - on a per actor basis), but you can't specify the acceleration differently for each actor; it's either on at x,y,z or off.

papitorico

29-02-2008 03:20:41

So, it is not possible to create gravity effects like those in Mario Galaxy; running around a sphere (planet) or changing gravity direction on specific places of a stage?

Any Idea to solve this interesting question?

hevi

29-02-2008 04:23:37

Actually I have a basic solution; according to creatures up vector I can find the required anti-gravity force to apply to the creature, gues up vector is perpendicular to direction of the gravity then if I apply a -Gravity force to the creature it wont be effected by the gravity. but this causes some other problems according to my game logic. in addition, i have to check for the creatures up vector in every game loop which is not an efficient solution :(

I gues Mario Galaxy is not totaly physics driven which means, most probably they send a ray in the negative direction of mario's up vector and they find the intersection point (and normal of the point) between the ray and any object after, they set the up vector to the normal and position to intersection point+normal*correction(half height of mario)
I totally guess :)

and waiting for any idea or suggestions.

betajaen

29-02-2008 10:51:10

No it's perfectly possible to do things like in Mario Galaxy, I've tried custom gravity effects in the past and it's worked fine.

Infact the new character system will allow you to walk up walls, or use a custom gravity vector regardless of the global gravity constant.

papitorico

29-02-2008 12:22:46

Thnx guys!!!