How do I attach swivelling sword arm to sprite

0 favourites
  • 4 posts
From the Asset Store
The Stickman Sword is suitable for platformer / sidescrolling games
  • Hi, I'm new to both Construct2 and programming, and scratching my head on how to attach a sword arm sprite object to a body sprite object. The view is top down, the sword arm should pivot 90deg from 12 o'clock to 3 o'clock from the sprite's shoulder using the arrow keys. I've worked through the beginner tutorial from start to finish four complete times, but have no clue how to achieve what I want. I've defined origin points on the two objects, I've created a 'pin' behaviour on the sword arm, but that's as far as I get. There doesn't seem to be anything further you can do with the pin once you've created it - just rename it is all!! And then how to get it to pivot with the arrow keys - I know it must relate to the keyboard object, which I also created, but how to link left right keys with pivot? I'm sure it's really simple to do, and sorry for such basic questions.

  • Use "Pin" behavior to attach one sprite to another.

    So add Pin to the arm, the add event System - On start of layout -> arm - Pin to object Body

  • Yeah, you use the event sheet. Be sure to specify "position only" as the pin type. Then give your arm object the "rotate" behavior and give events to rotate some positive speed when right is down and angle is greater than zero, else rotate negative when left is down and angle is less than 270, else rotate with speed zero.

    And at all costs, avoid the walruses...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sussed it!! fantastic, very many thanks for your help

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