can I change type of the node through script?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By nitin_aditya

so I was trying to make a topdown shooter in this engine, and my project is probably done, but the bullet stays in the ground it floats around and stays there, making it less exciting because the bullet kills the enemy every time it approaches to me, even though the bullet is floating, so i thought i could the change the type of the node to a static by and then make it disappear after a few seconds… help me!

:bust_in_silhouette: Reply From: AlexTheRegent

You can’t change type of node. You can disable bullet’s collision when it hit something and then delete it after few seconds using timers.

# on collision
bullet.collision_mask = 0
yield(get_tree().create_timer(2.0), "timeout") # delete after 2 seconds