Game Development Reference
In-Depth Information
ment that are added to an inventory. In many cases, it's similar to the EnterableTrig-
ger except it only requires a radius to see whether someone is within the pickup range or
not. We keep track of the actor that enters it so that we know who to apply the pickup to.
In this recipe, the pickup is represented by an object called Pickupable .
Once it's picked up, we set pickedUp to true so that it can't be picked up again and de-
tach the model from the node tree to make it disappear. If it is a recurring power up, a
delay can be used here to make it available again after some time.
Pickups in games usually stand out from other objects in the game world to draw attention
to them. How this is done depends on the game style, but here we apply a small rotation to
it in each call to the update method.
Since Pickup also extends Trigger , it's possible to use it to trigger other things as
well!
Search WWH ::




Custom Search