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

Add possibility to "Create New Node" at editor cameras global transform origin #6186

Closed
Dadaskis opened this issue Jan 28, 2023 · 10 comments
Closed

Comments

@Dadaskis
Copy link

Describe the project you are working on

First person shooter (3D) with immersive elements that implements some Source mechanics such as "LocationProp" node, which are really helpful to add more to gameplay and visuals of the game, and, of course, which are used quite often. Godot 3.5.1.

Describe the problem or limitation you are having in your project

Whenever i create a new node using "Create New Node" window (that can be opened by using Ctrl + A or by pressing "+" button), it's created at [0, 0, 0] which is making development quite harder. Each time i create a node (NPCSpawn, LocationProp, LocationSound, etc), i have to move my editor camera at [0, 0, 0] to drag this node to place i need.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

If i'll be able to get nodes at cameras position, that can drastically increase my development speed in cases when i use these nodes, and, trust me, i have to use them a lot.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Probably a checkbox at "Create New Node", named "Create at camera origin"

In code... if node supports global_transform property...
node.global_transform.origin = editor_camera.global_transform.origin

I don't really know how it works inside, but i really wish to make it use editor camera of first perspective viewport.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Sadly i can't make it on my own. If i could get access to editor cameras, i'd try to implement it on my own. Currently it is possible to get access to editor cameras, but in quite tricky, hacky ways (which can be broken at next update). I understand that editor API changes can be hard, so i ask you to make this specific function i wanted to make on my own with a hope it's easier to make for you.

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

As i said earlier, there is no way to get access to editor cameras in normal meaning of this word. Otherwise, it could be pretty much possible. Additionally i think that if such functionality will be implemented in the engine itself (without any need to search for addons) it can make the life of users more comfortable, if they have such case as mine.

@Dadaskis
Copy link
Author

image
This is the window i mean. Of course, i'm not sure if there is a lot of people that use similiar workflow, since, as i understand, people prefer to make scenes for such cases and just drag&drop whichever scene they want. I personally don't really like such workflow with scenes, so i prefer to replicate Source entities such as "prop_static." Such workflow is really comfortable for me even with a such problem i mentioned. Currently the only workaround is selecting existing nodes near-by, duplicate them and change properties

@yosoyfreeman
Copy link

yosoyfreeman commented Jan 31, 2023

While i personally understand the frustration i think this is very specific use case. In my understanding, placing the object in the camera is of equal priority of putting it anywhere else, for example, a user may want to spam the nodes near anything else.

I personally create the nodes inside the camera and drag them out. Is pretty quick and easy, could this be a solution for your problem?

@Dadaskis
Copy link
Author

Dadaskis commented Jan 31, 2023

i think this is very specific use case

That's why i suggested making a checkbox if people would like to keep creating new nodes at [0, 0, 0]

I personally create the nodes inside the camera and drag them out

I'm sorry, but i don't really understand this part of the comment. Are you talking about your own game editor? It's fine, but i'm talking about Godot Engine editor itself, in which new nodes, no matter what, are being created at [0, 0, 0] and there are no options to override such behavior. I would like to write my own game editor, of course, but in my opinion, Godot Engine editor itself covers 99% of use-cases that i need for creation of this project, so there is no need for doing that much work when it's already done. But if you are talking about Godot Engine editor itself, i'm wondering how did you override such behavior, and i hope it's not about using tricks with tool scripts with getting editor camera, that can be broken at the next update

@yosoyfreeman
Copy link

I don't understand what you mean by my own editor, I use Godot. I just create the new nodes as a chlid of a node in the zone i want, which will be spawn at the position of the parent, then un parent it.

@Dadaskis
Copy link
Author

This is not really different from making duplication of props, but gotcha. Still even in this case i'm pretty sure there is people that would like to see this feature come true, and even in your case, i think that'd be nicer to get it to global origin of the camera rather than doing reparenting all the time. It might not be crucial for your workflow, but this small addition i'm asking for can enhance possibility of this engine to support more various workflows in more comfortable way

@Calinou
Copy link
Member

Calinou commented Jan 31, 2023

Creating a node at the current camera position may be confusing. Instead, it may be better to queue node creation until you click somewhere, and create the node at the clicked location (using a raycast to determine where to place the node exactly).

@Dadaskis
Copy link
Author

Creating a node at the current camera position may be confusing. Instead, it may be better to queue node creation until you click somewhere, and create the node at the clicked location (using a raycast to determine where to place the node exactly).

I love that suggestion! I suggested the most oversimplified option, but if this is going to be implemented instead of my suggestion, that will be even better, mostly because it will replicate the way how you can create new entities at Hammer Editor where you can pick certain tool and place a new default entity. In case of Godot, if creation of node will be delayed until clicking at certain point, that's gonna be even better than in mentioned Hammer Editor because you won't have to go to properties and change entity type, instead, you get what you picked immediately at the position you picked, this is going to be insanely awesome

@yosoyfreeman
Copy link

Creating a node at the current camera position may be confusing. Instead, it may be better to queue node creation until you click somewhere, and create the node at the clicked location (using a raycast to determine where to place the node exactly).

I think that is a perfect solution and flexible enough.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 27, 2023

Duplicate of #435

@KoBeWi KoBeWi marked this as a duplicate of #435 Feb 27, 2023
@KoBeWi KoBeWi closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2023
@Dadaskis
Copy link
Author

I'm glad you suggested it earlier and really, really hope it will come true

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

4 participants