Arms of sprite to follow mouse

  • I'm messing around and trying to create a prototype for a side scroller shooter.

    Now what I am aiming to do is be able to move a sprite, but have the arms be able to follow the mouse. (As to aim.)

    I've got the moving and everything else down easily enough.

    I have created 2 seperate sprites, one being the Body and the other as the Arm.

    I've Pinned the Arm to the Body sprite, I'm unsure if that is how I should go about it.

    But I am not able to make the Arm follow the mouse, essentially have it swivel on the Body and aim where I am pointing while the body stay where it is.

    Could anyone give any insight on how I could remedy my frustration on this?

    (I would check the manual, but I am having trouble accessing the Main Scirra website at the moment.)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Arm set angle towards position x: mouse.x - y: mouse.y

    for this to work the origin of your arm should be on the turning point.

  • Ah, Thanks Heaps, fixed my issue.

    Was a simple one, I was making it Set Position for some reason instead of Set Angle Toward Position. Always the small overlooks that get me.

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