Tracking Missile Won't Hit Ship

KamazarKamazar Member Posts: 287
edited November -1 in Working with GS (Mac)
I have a missile. When I press a button, a missile is launched. The missile then proceeds to hit a ship. The ship is moving to the right. The missile misses the ship to it's left, sorta like the earth/cannon-ball model. How do I get a missile to hit a ship every single time?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    I have a similar problem - sometimes my lasers just bounce off their targets! Or the collision triggers an explosion, destroys the missile but leaves the target intact.

    Intact and ANGRY....

    Any help?

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • xactoxacto Member Posts: 146
    Can you post your code?
  • KamazarKamazar Member Posts: 287
    It's pretty simple. All I do is constrain the position of a ship to two real attributes, and have a missile accelerate towards that location.
  • xactoxacto Member Posts: 146
    Try the "move to" command instead, or in combination. I do not think you can control the exact center location with accelerate towards since it is figuring out the arc (unless you make it very slow).

    Another thing...
    maybe you can subtract some number from ships position X. So the missile will move farther to left. (or + to the right)
    ex: Accelerate Towards Position: game.EnemyPositionX -20

    Not sure if this is what you mean ;)
Sign In or Register to comment.