0 votes

Since few days,

I try to making a simple shooter game with only Visual Scripting.
But after many tries, i can't achieve a basic instancing of my bullet (I use Node 2D).

I use Godot 3.1 (latest version from the official website).

thank you for your help!

asked Mar 21, 2019 in Engine by PiloeGAO (15 points)

1 Answer

0 votes
Best answer

Ok so you drag the Bullet.tscn from the Filesystem tab in, which creates a Preload of the bullet.

Then from Available nodes drag in Functions > Call, then set Call Mode to instance, set Base Type to PackedScene, set function to instance.

Connect your preload bullet node to the obj instance node.

Drag the node you wish to add the bullet instance to into your visual script editor from the Scene tab, holding down CTRL.

Get another Call node, this time set Call mode to Instance, Base Type to Node and function to add_child, then connect the Scene node you just added to the obj instance, and connect the return any from PackedScene.Instance() to obj node.

Heres what it should look like.

enter image description here

answered Jun 7, 2019 by vic.the.developer (112 points)
selected Jun 16, 2019 by PiloeGAO
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.