Hi I'm new to Construct and I have been having a little trouble trying to figure out a way to have my platform character carry an object over his head. I want him to be able to carry a object that he is overlapping when the player presses a button, and then when the button is pressed again he will throw or drop the object.
I tried searching the forums but I haven't found an answer yet.
So whatever you think the best way of handling this is please let me know. Thanks in advance.
Develop games in your browser. Powerful, performant & highly capable.
In its simplest form you want to be looking at using a flag variable like "Carrying" to see if you're carrying something, and use a private variable as a flag for instances of your objects you want to carry.
To pick up an object:
+Carrying is 0 (false)
To drop an object:
+Carrying is 1 (true)
---[Update object with new position coords]
And use an Always to position object above player:
---[Position object above player]
You can improve it by making sure that you can't pick up whilst overlapping more than one object, and you can't drop whilst overlapping another object.
Thanks a ton for your help I'll give it a shot.
Edit: This worked out really well, thanks.