playMaker

Author Topic: Parenting GO to a Canvas causing scaling issues  (Read 881 times)

Athin

  • Full Member
  • ***
  • Posts: 163
Parenting GO to a Canvas causing scaling issues
« on: March 27, 2020, 07:53:03 AM »
Heya,

I've been fighting this for awhile now trying to get it to work properly but I just can't figure it out. I'm hoping to get some help.

I have a Canvas set in screen space with the main camera attached to render.  When activated, this canvas comes over the current canvas.  In the middle I have an UI Image anchored for the center and a character GO as its child.  This character GO just goes crazy with its scaling.  When it spawns in, it starts at 446 scaling and regardless what size I scale the model in Blender, it seems to not change the GO in Unity.  I've double check that everything is correctly scaled in the Hierarchy as 1,1,1 too.   

The main problem with this is when I'm trying to add weapons and armor to this GO (like an RPG character screen), the scaling on those go crazy as well.  I've been fiddling with Set Scale actions but its only a band-aid for the problem (not that its even working that well either!).

Am I missing something basic or doing this the wrong way?  Any help would be appreciated.

Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Parenting GO to a Canvas causing scaling issues
« Reply #1 on: March 27, 2020, 04:13:28 PM »
Hi.

For parenting canvas stuff i use 'Set Transform Parent' but i am not sure if that will help you there

But if i understand well you are parenting 3D objects into a canvas?
Maybe that's not the best way to do this?

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Parenting GO to a Canvas causing scaling issues
« Reply #2 on: March 27, 2020, 07:29:27 PM »
Heya,

Yeah I got a 3D object going into the Canvas.

Basically looking to get a model character on the screen and users can swap out weapons/armor on the character and have it update on the character too.  Having the model in the canvas parented to a background image makes it resize itself depending on screen size. 

Its actually working fine other then this scaling issue.  I'm using some Set Scale actions to resize everything each time something gets added/removed from the character to make it work currently.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Parenting GO to a Canvas causing scaling issues
« Reply #3 on: March 29, 2020, 04:06:08 AM »
Hi.
Maybe try to ask on the unity forums.
as i think its not really a playmaker issue.
maybe some mesh settings.

Maybe you can make a empty panel and set the 3D object in it and then make a prefab from it.

and if you parent use Transform Parent