playMaker

Author Topic: Scale problem when I import an UI prefab with "Create Object" action.  (Read 1484 times)

Andrés_Art

  • Playmaker Newbie
  • *
  • Posts: 2
Hello, I'm going crazy trying to fix this. Please help.

When I import a prefab UI element into a canvas using the "create object" action, the scale of that object changes depending on the resolution of the game. The canvas is created at 1080. When I import the object at that resolution everything is correct. The scale of the imported object is 1.

However when I import the object and the resolution of the game is at 720, the imported prefab is scaled 1.5. It seems to be trying to compensate for the scale in some way.

I gather that the problem is from Playmaker, because if I drag the prefab directly from the project to the hierarchy when I am in game, the object always comes out at the correct scale, regardless of the resolution of the game.

Is there any possible solution for this?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Scale problem when I import an UI prefab with "Create Object" action.
« Reply #1 on: December 21, 2021, 09:28:35 AM »
Hi.
Its more like a unity issue.
what you can try is :
When you create the object, store it in a variable, then after creating and parenting do a 'Rect Transform Set Local Scale'

Andrés_Art

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Scale problem when I import an UI prefab with "Create Object" action.
« Reply #2 on: January 05, 2022, 09:07:01 AM »
Hi.
Its more like a unity issue.
what you can try is :
When you create the object, store it in a variable, then after creating and parenting do a 'Rect Transform Set Local Scale'

I add "Rect Transform Set Local Scale" from Ecosystem and I put it directly in an FSM into the Prefab that I spawn.

It works! Thank you!