+1 vote

if someone could give me a rough idea of how to spawn mesh objects. I know how to generate random layouts of rooms, but i'm new to GDScripts. :(((((

in Engine by (81 points)

1 Answer

+1 vote
Best answer
                var instanced_bullet=preload("res://impact.scn")

preload of bullet object/scene containg a bullet object with script moving it forward

                var bullet = instanced_bullet.instance()

assinging pre-loaded bullet instance to a new variable

                bullet.set_transform(get_transform())

placing not yet instanced bullet on start point of bullet trajectory

                get_parent().add_child(bullet)

instancing bullet obbject by adding it to a spatial

by (444 points)
selected by
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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.