Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Tzian

Pages: [1]
I really hate to do this but after trying so many different ways today, from trying to get this int value from one script to another or from my script to an FSM i am here tail between legs admitting defeat :(

I have looked at as many example i could find by google searching re. variables from script to script, and on here for script to fsm but i cant get any of it to work, im probably translating them to what i need incorrectly im sure.

so here goes

In my mapgeneration script i have a public int width and a public int height, they are being created randomly on awake and set in the field.

i know they are fine as my maps are generating correctly with these numbers.

i have a FSM attached to the ground gameobject, where i would like to use the width and height variables to scale the ground correctly to the size of map that has been created.

I have tried following the example here

checked script is  Using HutongGames.PlayMaker;
made public field   PlayMakerFSM MapGenFields;  (this is the FSM that is attached to the same game object as my script. Not sure how to code it for the drag and drop.

the example used String, so i thought poss i could just change that reference to Int, but i keep getting the error NullReferenceException: Object reference not set to an instance of an object.  it references this line of code on my script

Code: [Select]
        FsmString myFsmString = MapGenFields.FsmVariables.GetFsmString ("My string var");

I am probably not explaining this very well, and i am sorry if i have not followed proper etiquette re asking on forums, i forget things so easy :(

I am going to now go and see if i can find that way to put code up on here properly, sorry for the wall of text.


p.s I can do voice comms if that is prefered by anyone, have PlayMaker Discord chat setup, just let me know a time relative to GMT :D

Pages: [1]