0 Favourites

[Solved] How do I - Set angle of Motion to specific UID

  • I wan't to set the angle of a bullet to a specific sprite who's variables match up with a specific global variable. is there a way I can control this in a string?

    I have "Bullet angle of motion = (sprite.x, sprite.y) degrees,

    but is there a way I can incorporate a specific sprite?

    What I mean is, in the condition I have

    "System = Pick sprite where sprite = GlobalVarUID" But I assume this does not exactly help, since the bullet angle does not go to the sprite who's UID is equal to the Global Variable UID.

    Is there a way I can type out "sprite.UID=GlobalVarUID.x" or something along those lines?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Theres a condition to Pick By Unique ID

  • Ah, yes thank you, but I was hoping more for a way to set the angle of motion by mouse click to the target who's UID is whichever the one that the system holds in it's global variable at the moment.

    Basically I have this bullet and I need it to collide with the sprite but the bullet is launched at the target who has the same UID as the Global UID Variable - is what I would like to happen.

    The pick by unique id would require me to memorize each sprites id, or atleast check in the layout sheet each time I would have to change it, and with constantly spawning and destroyed sprites I don't think I could manage that all too well.

    I was more hoping for a lesson on "This is what you should be typing in" if what I wanted is even possible.

    I am able to have the system pick by comparison, the sprite's UID = GlobalVarUID, yes, but I don't know how if at all possible to make the bullet angle towards that very same UID.

    I thought by having that condition, the following action "Set bullet angle towards sprite.x, sprite.y", the sprite in question would be the same one that the condition picked.

  • Heres my shoddy attempt

  • in your example delete

    bullet - set bullet angle of motion to ...etc

    and replace with

    bullet - set angle towards (target.x,target.y)

    (at the moment all you are doing is setting the bullet angle to 2,3,4 or 5 degrees (ie the uid of the chosen target))

  • you might, or might not, find this interesting ...

    beta r210

  • Thanks RamPackWobble , that definitely was interesting to watch, pretty mesmerizing.

    I think this is pretty damn close to exactly what I needed, reading over your notes now, thanks a lot!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)