Making an actor's movement follow the ground

G.A.S.P.IndustriesG.A.S.P.Industries Member, PRO Posts: 25
edited April 2012 in Working with GS (Mac)
Hi,

I am having trouble making an actor's movement follow the ground. I want to create many actors (non player actors) that come out onto the screen and basically "walk" on the ground. If the ground has a "ditch" I want the actor to fall into the ditch but not through the ground. It will be like a platformer but this is for the non player actors.

I have tried use the "move to" commands and the "accelerate" command together in the rules and collide. The reason I have tried to use the Move To and Accelerate is because when I created a "speed bump" (using collide) my actors fly off when they hit it and don't return to the ground. I added the accelerate as an alternative to using scene gravity. But it seems like accelerate just makes the actors fall through the ground even though there is a collide function and move to function.

So I have this non player actor now using the move to (x is to a specific point while the Y i would on self position), accelerate (270 for downwards towards the ground and relative to scene) and collide when hit ground.

I am new to this and watched some tutorials. If anyone has an easier way to do this I would greatly appreciate it. Thank you.

Best Answer

  • PhoticsPhotics Posts: 4,172
    Accepted Answer
    Personally, I prefer the accelerate method to simulate gravity. Although, with multiple actors affected by gravity, it might be better to use the gravity settings. I'm not sure if that's the issue though. How is this ditch being created? Are you using multiple actors?

    While not exactly the same, I created terrain collisions in BOT with invisible actors. Basically... one actor is a picture of the scene, and then invisible circles and rectangles/squares lay on top of the picture.

    Here's a link to an article that I wrote about hitboxes...
    http://photics.com/hit-boxes-using-rectangles-to-make-complex-shapes

Answers

  • G.A.S.P.IndustriesG.A.S.P.Industries Member, PRO Posts: 25
    Thanks Photic. Yeah, i realized i had the ground on circle checked so my object which was also circle would fall through the screen when using accelerate. Rectangle seemed to fix it. I will use your example. Thanks again.
Sign In or Register to comment.