Toggle If Holding and a Touch Of Physics

0 favourites
  • 5 posts
From the Asset Store
Everything is made via physics, Very simple code: 6 events only (3 for tank creation, 2 for controls and 1 for camera)
  • Space Engineer

    Hey guys, I would like to have my spaceman pick up objects and not be able to pick up anymore objects till the one he is holding is destroyed or put somewhere else.

    Also I was wondering what is the most efficient way of making objects float around and bang against each other? My character doesn't collide with walls even though they are solid.

    Thanks computer friends.

  • .caproj isn't correct file, you should to change from .caproj to .capx because it's A SINGLE FILE.

    .capx is like zipped version of .caproj and the folders.

  • Oh snap thanks Joannesalfa! fixing now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In regards to the collision detection; the CustomMovement doesn't collide with Solid objects. I would recommend utilizing either an 8'directional movement, or car behaviour, for it to collide. Edit it within events to get it feeling very 'astronaut'.

    Now, to get the character to hold an object, you're going to have to make a boolean instance variable called IsHoldingObject, and by default set it to FALSE. Also set a PIN behaviour to the boxes, and add in an image-point in the astronaut's animations, where he would normally 'hold' the objects.

    Now, when the astronaut collides with a box, it checks if the astronaut [not]IsHoldingObject, and then sets the position of the collided box to the image-point (that I mentioned earlier) of the astronaut. Then, pin the box to the astronaut, and set IsHoldingObject to TRUE.

    You can have a particular button which will drop the crates, such as the space-bar. When that key is pressed, make it check if IsHoldingObject = true, and if so, unpin the NEAREST (to the astronaut's image-point) crate.

    Also, the crates should all have physics, with no gravity, on them. That's how they'll bounce realistically.

  • WOWZERS! thanks Brock! what an amazing and perfect answer you are a champion man! I really appreciated the help!!!!!!

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