playMaker

Author Topic: set parent action not working correctly  (Read 9548 times)

invayne

  • Full Member
  • ***
  • Posts: 105
set parent action not working correctly
« on: April 25, 2015, 08:59:16 AM »
ever since i updated to latest version of unity the set parent action no longer works like it should.  it was working fine before i updated but now it no longer works  it shows in the hierarchy  as it setting correctly but  its not. im using unitys layout scripts  to set up my photon  join room list with ugui now if i drop my button prefab in to the same spot it works like intended... heres a video showing whats happening

https://drive.google.com/file/d/0B2KNNC0HS0DmZTZfLUtmOFQwZDA/view?usp=sharing

invayne

  • Full Member
  • ***
  • Posts: 105
Re: set parent action not working correctly
« Reply #1 on: April 25, 2015, 09:37:00 AM »
so seems with creating the button then setting it whats causing the issue so i need some ideas on how to do this now since i need to have a room list using the new ugui so if anyone knows how to do this  plz do tell...

invayne

  • Full Member
  • ***
  • Posts: 105
Re: set parent action not working correctly
« Reply #2 on: April 28, 2015, 12:39:45 PM »
bump please dont make me wait  over 10 days again

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: set parent action not working correctly
« Reply #3 on: April 28, 2015, 01:44:11 PM »
When you are doing Reset Local etc etc on the Set Parent it changes some Transform properties. I'm guessing this is getting screwy since you're dealing with UI components and their transform is a lot different than regular GameObjects. You can see the Scale and position are different from the one you just drag into the list versus the one you spawn and set parent on.

I don't really have a clear answer, but I think its something along those lines. Might check the Unity release notes to see whats different between the version you were using and the version that you upgraded to, related to UI, and then try tinkering with the Rect Transform of the list item.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: set parent action not working correctly
« Reply #4 on: April 29, 2015, 01:11:05 AM »

invayne

  • Full Member
  • ***
  • Posts: 105
Re: set parent action not working correctly
« Reply #5 on: April 30, 2015, 12:57:30 PM »
i would use that action but.... you get this error


Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.
UnityEngine.Transform:SetParent(Transform, Boolean)
HutongGames.PlayMaker.Actions.SetTransformParent:OnEnter() (at Assets/Script/SetTransformParent.cs:52)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32)
HutongGames.PlayMaker.FsmState:OnEnter()
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:UpdateState(FsmState)
HutongGames.PlayMaker.Fsm:Update()
PlayMakerFSM:Update()

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: set parent action not working correctly
« Reply #6 on: April 30, 2015, 01:05:12 PM »
You must target the Scene object, not the Prefab.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

invayne

  • Full Member
  • ***
  • Posts: 105
Re: set parent action not working correctly
« Reply #7 on: April 30, 2015, 01:15:41 PM »
still not working get same problem as before.. so im guessing its now impossible to make a list  with playmaker with the new u gui....  this is using the action that  jean posted as well

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: set parent action not working correctly
« Reply #8 on: May 01, 2015, 01:29:53 AM »
Hi,

 I confirm you can. I have made it numerous times already. I'll work on a Ecosystem sample to demonstrate this, bump me mid next week if I haven't published it yet.

As Lane said, The error here shows clearly that it's an issue with what Unity allows or not within a prefab. So you are I think trying to modify the prefab sitting in the project, not the instance you created at runtime based on this prefab.

Bye,

 Jean


invayne

  • Full Member
  • ***
  • Posts: 105
Re: set parent action not working correctly
« Reply #9 on: May 03, 2015, 02:45:00 PM »
ok will do sorry missed my email notification on this

invayne

  • Full Member
  • ***
  • Posts: 105
Re: set parent action not working correctly
« Reply #10 on: May 06, 2015, 12:00:59 AM »
bumping this thread to remind jean about the example..


 thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: set parent action not working correctly
« Reply #11 on: May 06, 2015, 02:04:25 AM »
Hi,

 I have done it yesterday, thanks for reminding, I could not find your post.

https://twitter.com/JeanAtPlayMaker/status/595596254563958784

http://hutonggames.com/playmakerforum/index.php?topic=10277.0

This will show a propery runtime listing of items, instanciated from a prefab, and parented properly ( as well as moved at the top of the list ( first sibling).

 So study that sample, it's simple, and you have some bonus with nice animation when item is added and removed from list, as well as simple communication to prefab to pass data ( here it's ID).


 Bye,

 Jean