Author Topic: Getting bricks position when destroyed  (Read 478 times)

I've tried using ::onDeath::onRemove and ::onDelete however they don't seem to get called on the brick itself that was planted, instead the argument comes up as some general object that doesn't relate to the planted brick, so just using .getPosition(); on it doesn't work.
Code: [Select]
-snip-
function brickCheckpointData::onRemove(%obj)
{
echo(%obj);
%pos = %obj.getPosition();


Parent::onRemove(%obj);
}
-snip-
This is pretty much the code that I've used for all of them, but had another argument down for the delete.

I'm going to assume that's for the Datablock of the brick, and the arguments should be (%this, %object)
This being the datablock, and object being the brick that is deleted.

Edit:
You could use this below to check to see if the bricks datablock matches that of yours.
Code: [Select]
function fxDTSBrick::onRemove(%this)
{
    if(isObject(%this) && %this.getDatablock().getID() == SomeBrickData.getID())
        %pos = %this.position;
    parent::onRemove(%this);
}
« Last Edit: January 12, 2015, 06:11:31 PM by Pah1023 »