playMaker

Author Topic: Set Property in Unity 5  (Read 2266 times)

turritom

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Set Property in Unity 5
« on: March 10, 2015, 03:39:05 AM »
i try to convert my Unity 4 Projekt to Unity 5 .. here i use the Set Property often.

you will see in the screenshots ..that in unity 5 the set property choice are diferent ..and in unity 5 the set property content are not assumed

unity 4

https://dl.dropboxusercontent.com/u/514672/unity4_property.JPG

unity 5

https://dl.dropboxusercontent.com/u/514672/unity5_property.jpg

where are the rigidbody propertys ;) ???

thank you very much
Thomas

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3134
    • View Profile
    • LinkedIn
Re: Set Property in Unity 5
« Reply #1 on: March 10, 2015, 07:11:02 AM »
Unity 5 removed these properties  :-\

Instead you now have to drag the component itself into the Target Object field (not the GameObject)

These component properties were removed to make the engine more modular. With GameObject always referencing all these components it would be impossible to do things like strip out Physics if it's not used etc.

So it's a good thing in the long run, but will definitely cause some confusion in the short term!

turritom

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Set Property in Unity 5
« Reply #2 on: March 10, 2015, 07:25:24 AM »
okay thanks for your reply

i have found a solution: if you want to set property in a gameobject from another gameobject ... you must add first a fsm to the gameobject do you want to set , for example the gravity, then drag and drop the rigidbody to the state ..then set property ..and then copy and paste this to the gameobject from where you want to activate or deactivate the gravity :) i hope this is understandable ....my english ist not the best :D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 11626
    • View Profile
Re: Set Property in Unity 5
« Reply #3 on: March 11, 2015, 12:14:24 AM »
Hi,

 Made a troubleShoot entry for this, as it will create lots of frustration and confusion.

 Bye,

 Jean

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2483
  • Yup.
    • View Profile
    • Cleverous
Re: Set Property in Unity 5
« Reply #4 on: March 11, 2015, 04:16:34 AM »
okay thanks for your reply

i have found a solution: if you want to set property in a gameobject from another gameobject ... you must add first a fsm to the gameobject do you want to set , for example the gravity, then drag and drop the rigidbody to the state ..then set property ..and then copy and paste this to the gameobject from where you want to activate or deactivate the gravity :) i hope this is understandable ....my english ist not the best :D

Use the Lock button at the top center of the Fsm Graph View to lock the view to that GameObject, then you can freely select a different GameObject and drag the component to the Fsm.

turritom

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Set Property in Unity 5
« Reply #5 on: March 12, 2015, 01:57:57 AM »
thanks a Lot! i will try it today at the evening :)

szomaza

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Set Property in Unity 5
« Reply #6 on: July 08, 2015, 10:32:23 PM »
Hi,

I am using set property in a prefab.
(After the prefab is created I get the rigid body component of a game object stored in a global variable. Then I get the HingeJoint component of the prefab just created and finally set property of the prefabs' Hinge Joint's connectedBody to the RigidBody of the object stored in the global variable.)
I hope this is understandable.  :-)

In short: spawning prefabs and connecting them, physically, to an already existing game object.

Am I right that in Unity 5 I will not be able to fix this?
I can't drag components of other game objects into an FSM of a prefab , as the prefab will not store these.

Please clarify this for me and help in figuring out a workaround.

Thanks in advance,
szomaza

szomaza

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Set Property in Unity 5
« Reply #7 on: July 25, 2015, 01:58:16 AM »
So going from Unity 4 to 5 it is pretty hard to locate all the Set and Get Properties that have gone missing. Se attached image.
Could there be an error or warning message from playmaker that would help you jump to the states with such problems?

Of course sometimes you want to set properties to "none", so it won't always be an error.

In the troubleshoot entry you write: "... Components like RigidBodies have been removed from the Default GameObject set of properties"

An exact list of things that are now removed might also help in locating them.

But a list of warnings would be the best:
Property not set (set to "none"). Are you sure? Click to jump to state.

Br,
szomaza