Tuesday, April 16, 2024
HomeSample Page

Sample Page Title


You say that:

Upon beginning the sport that is printed out, with out the participant having shot:

Entered: Player
Entered: Level
Freed

This counsel that you’ve a an occasion of the Area2D within the scene tree earlier than hand. What you need is to have the bullet and no matter it wants as a separate scene that you simply occasion.

Which is what I count on the road Bullet.occasion() does. To be clear, right here Bullet should discuss with a PackedScene loaded from a separate scene file.


And you say that:

When capturing into the second KinematicBody2D, nothing occurs in any respect, the bullet solely will get freed after exiting the display.

This counsel that the "body_entered" sign is just not linked on the Bullet scene (on the separate file, that you simply loaded into Bullet the sign is just not linked, in all probability). I’m guessing you solely linked it on the occasion you might have in your scene tree earlier than hand, which explains why that one prints Entered: Player and Entered: Level.


I may be guessing improper. But, basically phrases: You desire a separate scene file for the bullet, that you could load and occasion on demand (I’m guessing you have already got it). Make positive that separate scene file has all that it must work, in order that they work regardless or the place or whenever you occasion it. You might make the most of Autoloads – which can be found in all places on a regular basis, except you take away them explicitly – if it’s essential to get one thing from exterior. Also be sure you do not have a bullet instanced within the scene earlier than hand.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments