In my program there are two moving objects: player's bullets and the monsters.
This is the script that move the monsters:
# Called when the node enters the scene tree for the first time.
pass # Replace with function body.
and the script of the bullets:
var itsspeed = 4
if position.x<1 or position.y<1 or position.x>(get_viewport_rect().size).x or position.y>(get_viewport_rect().size).y:
The first problem when I coded this that when more than one monster are in the screen, the bullets shot down the first enemy but the others push away the bullets.
Besides I couldn't get the properly name of collider with this code:
Therefore I was forced to use an own variable ("team") to identity the collided objects. It works, but I don't know why push away the enemies the bullets and the bullets each other otherwise?
The second problem is that as if would exist an invisible instance of the enemy monsters on the screen, although I load it from another scene. But when I shoot, the bullets often destroy at the place where the monster exists, but in another scene.
And the Score indicates hit in this case.
Has anyone encountered a similar problem in own games and can help me?