Global to local space in editor?

When I create an object, it spawns at 0,0 world space in my 2D game, instead of relative to the parent. Please help?

What kind of help do you desire? Help with your code? Unfortunately if that’s the case, we can’t see it.

Here’s the Instantiate docs in-case you’ve not read them. Maybe you’re passing something wrong there such as the parent GameObject etc. It’s all guesswork though without some info.

Maybe this example will help too: Unity - Manual: Instantiating Prefabs at run time

Thank you! Actually, I have no code. I made an empty game object and added a sprite on top of it, as I need a number of sprites. The sprite was set at 0,0, but it was not on top of the parent.

But… you posted your question in the scripting forum, so where’s the scripting part exactly? What exactly do you expect to get from us? What exactly do you want to do that currently does not work and how is that related to scripting? If this is just about using the Unity editor, it’s most likely the wrong subforum. Maybe this belongs to the Editor and General Support forum? In any case, you should be more clear about what you actually want from us :slight_smile: We can’t read minds.

Sounds like you’re asking about sorting order now and nothing to do with “Global to Local space in Editor” so this is indeed a 2D question by the sound of it.

As above, it’s super unclear what you’re referring to and what help you need. Please put some effort into describing what you’ve got and what you want. Maybe an image or two.

Thanks.

1 Like

I’m not sure how to word it, then. Apologies for that.

So, I right click and select create empty. Then, while the empty is selected, I right click and select 2D → sprite → circle. The sprite is not on top of the empty upon being created. I’m not exactly sure why. Weirder yet, both the empty and the sprite claim to be at position 0,0.

Again, I think images would help because I’m not following what you’re trying to descibe. But I did provide a link on how render order is controlled which should give you everything you need. Render order is not related to when you created objects, that wouldn’t be useful.

Darn it. I made a new project and now it works? I wish it wouldn’t have, as this isn’t the first time I had this issue. If I ever see this again, I will post here.

Glad it’s working. I still have no idea of the problem though. :slight_smile:

Let’s see if this works…

So the player is highlighted at 0,0, but the character sprite is a good distance from it, yet it’s positioned at 0,0.

Shoot. I haven’t done this in a while… I wish I could just drag and drop it onto the forum…

Testing… https://1drv.ms/u/s!AgQKenLrWBXeje4Q6_Gc9bOnSQ6RaQ?e=dCv4BS

Should work now.

Please, just edit your posts. This is a forum, not a chat room. Each time you post, we get notifications.