I have 2 objects - player base and player. Player object is always at player base's position. player base have private variable - hp. How do I do so. If player base's hp=0,both object destroys?
Develop games in your browser. Powerful, performant & highly capable.
Already tried the container object? If both are in one container, both should be destroyed.
The other way is like you already discribed. If private variable 'hp' is 0, then destroy "object".