Unlink arbitrary number of multiple instances of the same object in bge using logic bricks

by se64   Last Updated October 01, 2018 18:15 PM

I have recently started using the Blender Game Engine using logic bricks (I will get to python soon I hope), and I'm trying to make a simple game where the player stacks cubes. I want a cube to spawn whenever the player presses 'c', which the player can then move around and stack as they like.

The spawner is an empty axes which uses an Edit Object actuator to add an object whenever 'c' is pressed. In order for the player to move the cube, I parent the cube to the player when there is a collision while the player is pressing 'z'. Then the cube follows the movement of the player until the player presses 'x' to release it.

The problem arises when I have multiple cubes present. Because are cubes are spawned as the exact same object, when there are multiple cubes all of them are parented to the player rather than the one. This means that all cubes move when I only intend a particular one to move.

Does anyone have any advice on what would allow each cube to act separately? Is it even possible using logic bricks when the number of cubes isn't preset?

Thanks for your help, and apologies if this question wasn't clear.

Related Questions

How can I spawn a moving object in BGE?

Updated June 10, 2015 03:06 AM

How do you make bullets do damagein the BGE?

Updated August 12, 2015 19:06 PM

Track To Added Object

Updated July 03, 2015 13:06 PM

Steering Actuator Seek Near Sensor Transition

Updated April 29, 2016 08:06 AM