Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Richer instance method #1865

Closed
jcostello opened this issue Nov 20, 2020 · 2 comments
Closed

Richer instance method #1865

jcostello opened this issue Nov 20, 2020 · 2 comments

Comments

@jcostello
Copy link

jcostello commented Nov 20, 2020

Describe the project you are working on:
3D shooter

Describe the problem or limitation you are having in your project:
I found myself repeating the following code in order to instance an object to a position inside the scene

var bullet : RigidBody = Bullet.instance() 
bullet.transform = self.global_transform
get_node("/root/World").add_child(bullet)

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
To have a richer instance method that accepts more parameters

var world = get_node("/root/World")
var bullet : RigidBody = Bullet.instance(world, self.transform)

Maybe we can add another parameters that make sense too

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
See above

If this enhancement will not be used often, can it be worked around with a few lines of script?:
The idea is to reduce duplicated code

Is there a reason why this should be core and not an add-on in the asset library?:
this work only on code

@Calinou
Copy link
Member

Calinou commented Nov 20, 2020

Duplicate of #1513.

@jcostello
Copy link
Author

@Calinou sorry, I didn't found it earlier. My bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants