Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: stain2319 on March 31, 2020, 09:47:18 AM

Title: using Set Property in a template and it keeps resetting...[SOLVED]
Post by: stain2319 on March 31, 2020, 09:47:18 AM
Hopefully I can explain this well...  :)

So I've got a system where there is a gameObject with a Text Mesh (3D Text) on it and I am using Playmaker to display a short sequence of messages to the player.  So I am trying do the following:

- I set up an array of strings - each string is one short message
- I want to run a ForEach in Array action on every element in the array
- The action should set the Text->String property of the Text Mesh
- Wait a few seconds
- Go to the next element in the array

Since the "ForEach in Array" only allows me to run an FSM Template I have created a template called "Updater" which gets run on every element.

This is using a "Set Property" action and this seems to work "sort of" but the problem is as follows:

- When I first create the template, I add the 'Set Property' action and then there is an inspector window for an object
- I drag the 'Text Mesh' and drop it into this field
- This allows me to see the properties and set Text->String to my inputString variable

However when I build the project it doesn't work - the text mesh never changes, it just shows the default/setup string every few seconds.

So I go back and look into my project and I load it up and I notice that inside my template, the object which I had earlier drag-and-dropped (the text mesh) isn't there and I just have a (None) Window. It's like it won't save the actual object I am trying to set properties on.

i tried adding a "Get Owner" to the object with the text mesh and store this in a global variable, but when I go into the "Set Property" window and try to use a variable, all I get is "None" and no option to choose any variables, global or otherwise.

Title: Re: using Set Property in a template and it keeps resetting...
Post by: djaydino on March 31, 2020, 10:45:27 AM
Hi.
if you use Set Properties actions you need to use Linker Wizard (http://hutonggames.com/playmakerforum/index.php?topic=11126.0)

You can find Textmesh acitons here :
https://hutonggames.com/playmakerforum/index.php?topic=15008.0

For your case you should use 'Array Get Next' instead of 'Array For Each'

This video can help on how to loop an array :

Title: Re: using Set Property in a template and it keeps resetting...
Post by: stain2319 on March 31, 2020, 02:54:16 PM
Thanks! Will check it out.
Title: Re: using Set Property in a template and it keeps resetting...
Post by: stain2319 on March 31, 2020, 06:31:49 PM
OK, Get Next worked like a charm.  Thank you again!
Title: Re: using Set Property in a template and it keeps resetting...
Post by: djaydino on April 01, 2020, 04:08:35 AM
Hi.
No Problem, happy to help