playMaker

Author Topic: Can't refer to object created stored in a variable  (Read 2037 times)

barichnikov

  • Playmaker Newbie
  • *
  • Posts: 9
Can't refer to object created stored in a variable
« on: August 19, 2014, 04:24:35 PM »
Hi,

I've encountered an error I can't figure out the answer to. I'm creating an object in my scene, using the Create Object action.

I store the object in a game object variable, called currentProjectile.

When I hold the finger down, I create the projectile from prefab, store it in currentProjectile, and start to increase force. When I release the finger and apply the force accrued on currentProjectile.

That, is... I'd like to. Playmaker won't let me use the variable currentProjectile in  other actions.

The error I see is the following:

Quote
ArgumentException: Object type HutongGames.PlayMaker.FsmGameObject cannot be converted to target type: HutongGames.PlayMaker.FsmOwnerDefault
Parameter name: val
System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoField.cs:133)
System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/FieldInfo.cs:150)
HutongGames.PlayMakerEditor.ActionEditor.DoVariableSelection (System.Object userdata) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionEditor.cs:2436)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/GenericMenu.cs:113)

As usual, I'm sure the mistake is dumb, but I can't figure it out. I searched the forums for this error message, but I can't find anything.

Thanks.

barichnikov

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Can't refer to object created stored in a variable
« Reply #1 on: August 20, 2014, 10:40:26 AM »
This is the same with ANY action that require a game object. I'm certain I've used those before without problems.

This is on Unity 4.5.2f1 with Playmaker.v1.8.0.b7

Is that the source of my problem?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Can't refer to object created stored in a variable
« Reply #2 on: August 20, 2014, 10:51:50 AM »
Have you tried it on the current beta version or the latest public version?

Post a repro scene if its persisting.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D