Toggle If Holding and a Touch Of Physics

Get help using Construct 2

Post » Sun May 20, 2012 5:20 am

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. KSLR2012-05-20 06:51:24
B
32
S
9
G
3
Posts: 275
Reputation: 8,063

Post » Sun May 20, 2012 5:55 am

.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.
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Sun May 20, 2012 6:50 am

Oh snap thanks Joannesalfa! fixing now.
B
32
S
9
G
3
Posts: 275
Reputation: 8,063

Post » Sun May 20, 2012 12:42 pm

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.
B
14
S
1
G
2
Posts: 85
Reputation: 2,810

Post » Sun May 20, 2012 8:24 pm

WOWZERS! thanks Brock! what an amazing and perfect answer you are a champion man! I really appreciated the help!!!!!!
B
32
S
9
G
3
Posts: 275
Reputation: 8,063


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests