playMaker

Author Topic: Scene variable doesn't work in builds. (SOLVED)  (Read 2488 times)

shanahan_sweet

  • Playmaker Newbie
  • *
  • Posts: 4
Scene variable doesn't work in builds. (SOLVED)
« on: February 28, 2022, 11:34:30 PM »
I'm having a weird problem: I'm using Get Property on an object variable which contains a scene. When running my project in the editor this works fine. I'm able to save the name of the scene as a string. In builds however, the Get Property action doesn't register the scene object. It's like it doesn't exist.
I know this is a little confusing to put into words, and I'm more than happy to elaborate if necessary. Just wondering if anyone has run into this before.
« Last Edit: March 02, 2022, 06:04:47 PM by shanahan_sweet »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Scene variable doesn't work in builds.
« Reply #1 on: March 01, 2022, 09:19:16 AM »
Hi.
You probably want to use Linker Wizard or use/create a (custom) dedicated action.
Get/Set Properties are mirroring and therefor not always included in builds, linker wizard will help there.

is this scene on a script or within a fsm.

shanahan_sweet

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Scene variable doesn't work in builds.
« Reply #2 on: March 01, 2022, 06:34:44 PM »
Hey, thanks for the response.
I also initially thought it was an issue with the get/set property actions and was going to use the linker wizard. However, I did some additional testing, and it turns out this is not the case. Both actions function perfectly on their own in my builds. It's only when I try to use a scene object that things break. I suspect it may be a bug within Playmaker or Unity itself.

I've attached an image of what it is I'm trying to do.

I should also mention I'm using Playmaker version 1.9.0, Unity version 2020.1.6f1, and exporting my project for PC only.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Scene variable doesn't work in builds.
« Reply #3 on: March 01, 2022, 09:03:17 PM »
Hi.
Maybe you can use the Action : Get Scene Name
There are different options on it.

shanahan_sweet

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Scene variable doesn't work in builds.
« Reply #4 on: March 01, 2022, 10:38:16 PM »
Thanks, I tried Get Scene Name, but wasn't able to achieve the same result. I think my main concern now is determining what's causing this apparent exporting bug, and what I can do to fix it. I'm currently upgrading to a new version of Unity & Playmaker. I'll post my results soon.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Scene variable doesn't work in builds.
« Reply #5 on: March 02, 2022, 08:45:01 AM »
Hi.
On the image i can see that it says UnityEditor.SceneAsset.
Which means that this will only work in unity editor.

upgrading/updating won't help.

shanahan_sweet

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Scene variable doesn't work in builds.
« Reply #6 on: March 02, 2022, 05:58:07 PM »
Oh wow, I'm glad you caught that, because I never would have considered it. I suppose that solves my problem in a way.
I'll have to find a workaround.
Thank you for your time.