Parenting

This forum is currently in read-only mode.
From the Asset Store
Parents only system
$4.75 USD
5% off
Template Parents only system with decimal numbers version for your proyects
  • I`ve just got the programme and i wanted to know how i can Parent my gun to my player atm its just a gun that moves with mouse and shoots but i can`t make it follow player.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I wonder this too.

    In my current project I have a variable that is checked, and if it is 1, I move the weapon on top of the player every frame.

    It works, but a Sword.Parent( Player ) would be a nice thing to have. <img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" />

  • Apparently that's what the Containers are for. I haven't messed with them at all, but you're supposed to be able to put your gun into your player's Container and it will move with it.

    I'll fiddle around with it some and see how it works.

  • You don't necessarily need containers to get this to work (containers are generally only useful if you have multiple object instances).

    The best way is to use image points. If you don't know how image points work, the Ghost Shooter tutorial explains them. Basically if you place an image point where you want your object to be positioned on your player, then you can use the event 'Always' - Gun: 'Set position to another object'. You can position it by the player, image point 1, and it goes to where you placed the image point in the picture editor.

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