Game Development Community

Pickups as physic objects.

by Sebastian H · in Game Mechanics Kit · 10/21/2009 (6:17 pm) · 4 replies

Hi...

Was wondering how you could make shapes that are "pick-up-able" to behave with the GMK physics pack.
Like an iron bar lying on the floor, which would roll around when you walk in to it, but be picked up when pointed to and selected... you get the idea... ;)

thx in advance
Sebastian

#1
10/22/2009 (12:53 pm)
it would be very easy to do something like that.....
#2
03/20/2010 (11:17 am)
well nice...
then point me in the direction?

my guess (and it is no more) would be that i would have to setup $ShapeType for the item, and then declare it as a physics object, when colliding with player, stop simulating physics and become a pick-up?

But does it involve altering source?

I can see how it would be easy for some people, but it ain't for me.

Any help would be appreciated.
#3
04/02/2010 (6:49 am)
@Sebastian H

I think it can be done without source modification, but I'm not 100% sure.

You sould look at InventoryItem.cs (inherited from Usable) and then make a combination of InventoryItem and RigidBody. Actually you should rewrite 'use' function end disable rigidBody at that point.


All usable functionality is in the function:
function Player::checkObjectsForUse(%this) of player.cs.
#4
04/02/2010 (11:21 am)
Thanks man... :)

I'll look into it soon as possible, and post whatever i find out inhere ;)

Nice to see the customer service is still "all that"