GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to make an actor move towards another actor???

QuantumGames94QuantumGames94 Posts: 13Member
edited May 2012 in Working with GS (PC)
Hi can anyone tell me how to make one of my actors move towards another one of my actors, I have a paddle with a constrain attribute to the Y axis and I want it to move towards my ball which bounces off the walls of my scenene so it can hit it back to the other paddle controlled by the player, how can i make the paddle not controlled by the player move so the ball will bounce off of it??? I have no idea what i need to apply to the paddle to make this work

Best Answer

  • lukey5227lukey5227 Posts: 111Member
    Accepted Answer
    Make a global attribute Ball Y

    In the Ball Actor

    Constrain attribute Game.Ball Y to Self.position y

    In the Computer Controlled Paddle Actor

    Set the position X by moving it on the main screen.

    Move to:
    X: Starting X
    Y: Game.Ball Y
    Speed: Speed Here

    Adjust the speed based on the difficulty. If you want it to be impossible for it to be defeated, instead of doing "Move To" you can make a Constrain attribute Self.position Y to Game.Ball Y.

Answers

This discussion has been closed.