Strange topic description perhaps, I'll try and elaborate clearly:
I have a collision event in a script called
ball.gd. It's attached to my
ball.tscn file. Within
ball.gd I have received the name of the body the ball has collided with. Like so:
var entity = ball.get_collider()
The entity is actually a brick, in my game of Breakout. It's an instanced scene of course. The brick has a variable built into it. The variable is called
I've tried things like
entity.numOfHitsRequired = x and other things but I just can't seem to set the variable. I want to reduce the
numOfHitsRequired variable WITHIN the entity I've collided with so the brick.gd can handle itself as required. There are hundreds of bricks so I'm trying to deal with the one that's been identified in
Any advice would be really appreciated.
EDIT: I've researched further and realised
get_collider() returns the BODY that the item collided with. So that would explain why
entity.numOfHitsRequired = x doesn't work. I'm still lost though. Just a little prod is all I will need I'm sure. Thanks again.