How to instance a scene with its rotation and scaling defined in editor?

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

Hey dear fellow godot people!
So my question is as follows:
Imagine you have a bullet with the size (1,1,1) and build the mesh that its facing upwards. Now you wanna rotate the whole construct but rotating the root node has no effect as well as scaling the root node has no effect. Yeah of course you could rotate or scale it later on BUT this does require a bit (no matter how few) performance.
Therefore : Is there a way to apply the changes made to a root node in editor to the final world. (Via instancing not direct placing.)

In my case the bullet consists of an area/mesh/collision shape and is instanced by a player
at a certain point.

Thank you very much for any help!!!

:bust_in_silhouette: Reply From: Omar13

I can’t understand exactly all your question…
You have something like this?

var NewBullet := preload(path_to_bullet_scene)

func _unhandled_key_input(event: InputEventKey) -> void:
if Input.is_action_just_pressed("shoot"):
	var new_scale: Vector2 = Vector2(...)
	var bullet = NewBullet.instance()
	bullet.scale = Vector2(new_scale)
    bullet.rotation =...
	add_child(bullet)

but you want to optimize performance 'cause instance + change scale/rotation + add_child takes performance?

I have this issue with unity (and the memory spike) making a bullet hell game
My aproach was to make an object pooling
But in godot I think is not so “simple” (most of the trouble is you have to handle all the scene you are preloading), not impossible, but harder.
I think this is a good answer about object pooling
https://forum.godotengine.org/26814/what-is-the-best-way-to-do-object-pooling

Hello there!
At first thank you for your answer!!!
Secondlly this concpet solves my problem only partly :
I wanted to rotate/scale a scene in editor (by rotating or scaling the root node) . This change shold have effect to the instance while in game. Though it has no effect and these properties have to be set manually in runtime so far. This consumes processing therefore i wanted to know if there is a way to apply editor properties.
(E.G. if you scale a scene in its own editro to 100,100,100 and instance it via code it will have the size 1,1,1 → only if you resize child nodes of your scene it would have any effect)

CoreTaxxe | 2020-05-03 08:28