Need help getting a projectile to accelerate to correct place

stannenstannen Member Posts: 16
edited November -1 in Working with GS (Mac)
I'm trying to get my projectiles to move to a specific X value and a random Y value. The X position works fine but my actors just move to the same Y position every time. For the Y value I'm using something like "random(30,290)" which I thought should work, but it doesn't.

Does anyone know what I'm doing wrong?

Comments

  • cbtcbt Member Posts: 644
    You need to trigger that random behavior with something. Because random is not so random. Create a self.integer and;

    Every xx seconds change.attribute:
    -Self.integer to random(30,290)

    When *someting* is true accelerate towards
    X:200
    Y:self.integer

    And keep in mind that "move to" behavior is not usable with random values..
  • stannenstannen Member Posts: 16
    cbt said:
    You need to trigger that random behavior with something. Because random is not so random. Create a self.integer and;

    Every xx seconds change.attribute:
    -Self.integer to random(30,290)

    When *someting* is true accelerate towards
    X:200
    Y:self.integer

    And keep in mind that "move to" behavior is not usable with random values..

    Interesting. I'll give it a try! Thanks.

    And I guess I shouldn't have said I was trying to get my projectiles to "move to" a position since I'm actually telling them to "accelerate towards." I've only been messing with this stuff for two days and I'm still learning all the technical jargon :)
  • stannenstannen Member Posts: 16
    @cbt Okay, I've tried it and I'm not quite getting the desired result. At this point my projectiles are spawning and then sort of teleporting to a random Y position, then moving in a straight line to the specified X position. I'm trying to essentially get them to move diagonally from their spawn point to the specific X and random Y in one continuous motion. I'm trying a whole bunch of different things but nothing's working right.
  • cbtcbt Member Posts: 644
    Sorry for answering late. What are your rules on the actor?
Sign In or Register to comment.