Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: enrickla on October 23, 2014, 12:04:33 AM
-
Hi Everyone,
I have Unity 5.0.0b8 and playmaker integrated. Playmaker work perfectly but when I try to compile, it give me this error:
Assets/PlayMaker/Actions/AddComponent.cs(56,88): error CS0619: `UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(UnityEngine.GameObject, string, string)' is obsolete: `Method is not meant to be used at runtime. Please, replace this call with GameObject.AddComponent<T>()/GameObject.AddComponent(Type).'
When I click the error, unity bring me at this line:
addedComponent = UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(go, "Assets/PlayMaker/Actions/AddComponent.cs (56,21)", component.Value);
Thank you for your help!
-
Unity 5 has some breaking API changes. Unity tries to update scripts automatically, but it looks like in this case it has mangled the AddComponent action.
If you're not using AddComponent you could try deleting that action, but Unity might have mangled more files...
Alternatively the current Playmaker 1.8.0 beta works with Unity5. If you PM me I can send you an invite to the beta.
-
This is happening with the Addscript action too, I deleted the Addcomponent action, but I still need the AddScript, any workaround?
-
Having the same issue in Unity 5 beta 18.
-
Was someone able to solve this issue?
-
Yep, you have to do:
var t = System.Type.GetType(component.Value);
addedComponent = go.AddComponent(t);
instead of the auto converted line that looks something like:
//addedComponent = UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(go, "Assets/PlayMaker/Actions/AddScript.cs (51,21)", script.Value);
Unity has a blog post about this api change here:
http://blogs.unity3d.com/2015/01/21/addcomponentstring-api-removal-in-unity-5-0/ (http://blogs.unity3d.com/2015/01/21/addcomponentstring-api-removal-in-unity-5-0/)
in AddScript it is the same thing with script.Value instead
-
The 1.7.8 update should fix this. Make sure you update PlayMaker in the Unity 5 Asset Store then import. Please let me know if this doesn't work! Asset Store support for different packages for different versions of Unity is still fairly new, so there may be teething problems...
-
The 1.7.8 update should fix this. Make sure you update PlayMaker in the Unity 5 Asset Store then import. Please let me know if this doesn't work! Asset Store support for different packages for different versions of Unity is still fairly new, so there may be teething problems...
I have 1.7.8 and I still got this error. I've integrated package from your store, so it's not and asset store error. But I I'll got to Playmaker -> About it shows 1.7.7.f6 is it normal or I did messed up something?
-
Update in the Asset Store or download from our store again. The about window should say 1.7.8.2.
Also if you're updating a Unity 4.x project, please see this thread:
http://hutonggames.com/playmakerforum/index.php?topic=9823.msg46693
And the troubleshooting page here:
https://hutonggames.fogbugz.com/default.asp?W624
-
I know I am a little late to the party here, but for those who refuse to update like I do, attached are addcomponent and addscript that have been updated for Unity 5. I include both of them, because both were needed for me as it stopped on one, and then the other when I got the first fixed. Replace them with your current ones and you'll be ready to rock.
-
I know I am a little late to the party here, but for those who refuse to update like I do, attached are addcomponent and addscript that have been updated for Unity 5. I include both of them, because both were needed for me as it stopped on one, and then the other when I got the first fixed. Replace them with your current ones and you'll be ready to rock.
Many thanks, mate ! =)
-
I know I am a little late to the party here, but for those who refuse to update like I do, attached are addcomponent and addscript that have been updated for Unity 5. I include both of them, because both were needed for me as it stopped on one, and then the other when I got the first fixed. Replace them with your current ones and you'll be ready to rock.
Really appreciate it! You the man!!! :)))
-
Many thanks as well! Need to build for a demo, no time to update, so again, many thanks!!
-
I'm happy we helped quite a few people here ;D I thought I was the only one refusing to update there for awhile. Just remember to check us out on Google Play Store. ;)
Most importantly thank you Jean for the most useful asset to ever come to Unity.
-
Hi,
All credits goes to Alex :)
Bye,
Jean