Need help with Floating an actor around a scene on own...

MarcusOMarcusO Member Posts: 147
edited November -1 in Working with GS (Mac)
Hi All,

I'm having a difficult time getting an actor to move around within a scene.

So the question is really two folds:

1) how do i define a rectangular area to have actors float around in?

2) how can i tell an actor to randomly float/move around within this specified area?

Thanks in advanced.
M

Comments

  • JeffreyShimaneJeffreyShimane Member Posts: 372
    You could try this:

    In the actor you want to float around, create a self attribute called random. Create a timer that changes the value of self.random (either at random intervals or at a specific interval) to 0-359. Add a Change Velocity behavior to the actor that uses the self.random attribute for its direction. Set the speed to whatever you want (you can also have the speed change randomly using the above technique). This will cause the actor to move around and change directions randomly.

    To define an area where the actor can move within, you can create visible/invisible walls that the actor can collide with or you can constrain its position so that it cannot go past certain X/Y values.

    - Jeff
  • MarcusOMarcusO Member Posts: 147
    Thanks Jeff.
    I'll try your suggestions.
    I'll let you know if they work.
    Cheers.
    M
Sign In or Register to comment.