playMaker

Author Topic: Change my Texture2D on my object from a FSM[SOLVED]  (Read 764 times)

MadToLive

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Change my Texture2D on my object from a FSM[SOLVED]
« on: July 17, 2014, 01:51:13 PM »
Ok so I have an inventory system building currently. I have a public var as such:

var sanityLev : Texture2D;

and later in the inventory script I draw that texture to a specific section of the inventory when you open the inventory/hit the inventory button.

Using this portion of code to draw the texture in the right area.

{
   GUI.DrawTexture(Rect(195,700,200,250), sanityLev);// Diplay First Sanity Texture
   }


I have a sanity tracking FSM, it checks the global sanity level of the character, depending on the threshold of sanity level of the main player, i want it to change the Texture2D image for the sanityLev on the inventory script.

 So say I have a brain image loaded up in the inspector to display when i first open the inventory. Then the character loses some sanity points later, when we open the inventory the Texture changed from a brain to a different image.

How do i accomplish this? I have not been working with Playmaker in awhile and everything I have found so far is confusing me. Does it have something to do with the Playmaker Set Property action? Would I use that somehow? Or something completely different?



SOLVED--------------------------------------------------------

Ok so that was actually super simple, I was trying to set the property of the wrong things, I was dragging the parent item in there and the objects in there trying to sort this out.

What I did that worked was I dragged the actual script onto the FSM, selected set property, in the drop down within that I found my variables that held the textures I wanted to change and bam. Done.
« Last Edit: July 19, 2014, 03:58:09 AM by MadToLive »