
0
Completed
Option to create objects as children
gabin.deboulogne 4 months ago
•
updated by Lazlo Bonin (Lead Developer) 3 months ago •
6
• 1 duplicate
Hi,
When i create an object with "ctrl + shift + click" the created object is not childed to the object its created on.
I debuged your code and i found this.
The set parent first param returns null instead of the raycast hit transform
I was able to fix this bug by changing the line 96 in Creator.cs from
instance.transform.SetParent(_hit.Value.transform.parent, true);
To
instance.transform.SetParent(_hit.Value.transform, true);
With this change the created object parent is correctly set
No offence but it makes more sense that the created object parent is set to the raycast hit transform instead of the raycast hit transform own parent
I made my tests in an empty scene with only one primitive 3d cube and with peek default settings
Unity Version:
2020.1.5f1
Peek Version:
1.3.0
Duplicates 1
Customer support service by UserEcho
Hi Gabin,
This is by design. The underlying logic is that when creating a scene and placing multiple objects, you normally want objects to be side by side, not deeply nested.
In Peek v.1.3.1, you now also get the option to place objects at the root instead.
I'll treat this ticket as a feature request to add a setting to place objects as children.
Hi,
Your logic only works if the raycast hit is childed to something
I've added a check in the code so object are childed whether or not they have a parent
Hi Tab Games,
Glad you're enjoying the asset :) And thanks for the suggestion.
Another user suggested something similar this week, so I'll merge your thread.
Currently, in Peek 1.3.1, there are 3 options for where Peek will place new objects created via the Creator:
I'll add another option for "Child" in a future version.
Hi,
Peek v.1.3.2 will include a "Child" option for creator parenting. Thanks for your patience on this.