playMaker

Author Topic: Cannot save template  (Read 5292 times)

bilke

  • Playmaker Newbie
  • *
  • Posts: 5
Cannot save template
« on: February 25, 2013, 06:41:07 AM »
I am using Playmaker 1.5.2 and I want to save a template. Everytime I get the following error:

Code: [Select]
Parent directory must exist before creating asset at Assets/Assets/PlayMaker/Templates/MainMenu.asset.
UnityEditor.AssetDatabase:CreateAsset(Object, String)
HutongGames.PlayMakerEditor.FsmBuilder:CreateTemplate()
HutongGames.PlayMakerEditor.FsmBuilder:CreateTemplate(Fsm)
HutongGames.PlayMakerEditor.EditorCommands:SaveFsmAsTemplate()
UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

Note that it always prepends the Assets-folder twice to the path no matter where I try save it. So in the path above there is one "Assets/" too much.

bilke

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Cannot save template
« Reply #1 on: February 25, 2013, 08:44:08 AM »
I have found out what is producing this error:

My project itself is in a directory containing "Assets", in my case it is "Test-Assets". It looks like Playmaker is searching up the path for the last occurrence of "Assets".

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4003
  • Official Playmaker Support
    • LinkedIn
Re: Cannot save template
« Reply #2 on: February 25, 2013, 11:35:19 AM »
I believe we get the Assets folder using the Unity API. In the past I've found it to be a bad idea to use the word Assets on a folder inside the Assets folder, it seemed to confuse Unity in some situations... but I'm not sure if that's what's going on here...

There are also some template bug fixes in 1.5.3, which was submitted Friday, but is taking a little time to get into the store... :-\

bilke

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Cannot save template
« Reply #3 on: February 26, 2013, 08:39:53 AM »
I have updated to Playmaker 1.5.3 and I am able now to save a template as a file. But e.g. when I add the "Activate Game Object"-action to a state in the template and I specify a GameObject there it is lost (the GameObject) the next time I load my Unity project. It is not automatically saved and it is also not saved when I overwrite the template file with "Save Template" from the Playmaker Editor context menu.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4003
  • Official Playmaker Support
    • LinkedIn
Re: Cannot save template
« Reply #4 on: February 26, 2013, 10:39:38 AM »
Is the GameObject a scene object? Templates are project assets, so can only reference prefabs. This is a Unity restriction. The usual way around it is to find the target object at runtime (e.g., by Tag).

I'll look into adding the same warnings I do on prefab editing to template editing...

bilke

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Cannot save template
« Reply #5 on: February 27, 2013, 02:10:34 AM »
Ok, thanks for the clarification.