playMaker

Author Topic: Unity 5 + Playmaker compilation error :/  (Read 14129 times)

enrickla

  • Playmaker Newbie
  • *
  • Posts: 1
  • Indie Game Developer
    • View Profile
Unity 5 + Playmaker compilation error :/
« on: October 22, 2014, 09:04:33 PM »
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:

Quote
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:

Code: [Select]
addedComponent = UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(go, "Assets/PlayMaker/Actions/AddComponent.cs (56,21)", component.Value);

Thank you for your help!
New Indie title + kickstarter coming soon!

Become a fan on Facebook:
http://www.facebook.com/enrickdev

Follow me on Twitter
@enrickdev

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3643
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Unity 5 + Playmaker compilation error :/
« Reply #1 on: October 22, 2014, 10:12:11 PM »
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.

Phuzz

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • Bzilla Games
Re: Unity 5 + Playmaker compilation error :/
« Reply #2 on: December 28, 2014, 01:15:05 PM »
This is happening with the Addscript action too, I deleted the Addcomponent action, but I still need the AddScript, any workaround?
Bzilla Games "Education with a Tickle!"
Qbucket Games "Voxel Games"

Game Daddy

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Unity 5 + Playmaker compilation error :/
« Reply #3 on: January 03, 2015, 02:09:56 PM »
Having the same issue in Unity 5 beta 18.

Mike Salvo

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: Unity 5 + Playmaker compilation error :/
« Reply #4 on: January 22, 2015, 02:36:08 PM »
Was someone able to solve this issue?

timofei7

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Unity 5 + Playmaker compilation error :/
« Reply #5 on: March 03, 2015, 07:10:30 PM »
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/

in AddScript it is the same thing with script.Value instead

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3643
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Unity 5 + Playmaker compilation error :/
« Reply #6 on: March 03, 2015, 08:11:15 PM »
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...

Gua

  • Full Member
  • ***
  • Posts: 180
    • View Profile
    • Andrii Vintsevych
Re: Unity 5 + Playmaker compilation error :/
« Reply #7 on: March 15, 2015, 08:57:55 PM »
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?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3643
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Unity 5 + Playmaker compilation error :/
« Reply #8 on: March 15, 2015, 09:04:04 PM »
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

90degreedesigns

  • Playmaker Newbie
  • *
  • Posts: 13
    • View Profile
Re: Unity 5 + Playmaker compilation error :/
« Reply #9 on: April 03, 2015, 02:54:42 PM »
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.

boragungor

  • Playmaker Newbie
  • *
  • Posts: 17
  • Who really wrote Beethoven's music to begin with?
    • View Profile
Re: Unity 5 + Playmaker compilation error :/
« Reply #10 on: May 20, 2015, 11:37:51 AM »
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 ! =)

HyperExc

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Unity 5 + Playmaker compilation error :/
« Reply #11 on: September 12, 2015, 04:54:12 PM »
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!!! :)))

memetic arts

  • Full Member
  • ***
  • Posts: 140
    • View Profile
Re: Unity 5 + Playmaker compilation error :/
« Reply #12 on: November 05, 2015, 02:29:55 PM »
Many thanks as well!  Need to build for a demo, no time to update, so again, many thanks!!

90degreedesigns

  • Playmaker Newbie
  • *
  • Posts: 13
    • View Profile
Re: Unity 5 + Playmaker compilation error :/
« Reply #13 on: November 05, 2015, 04:41:52 PM »
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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15398
  • Official Playmaker Support
    • View Profile
Re: Unity 5 + Playmaker compilation error :/
« Reply #14 on: November 06, 2015, 05:08:24 AM »
Hi,

 All credits goes to Alex :)

Bye,

 Jean