playMaker

Author Topic: Random Colors on Random Bouncing Cubes.[SOLVED]  (Read 2691 times)

swc220

  • Playmaker Newbie
  • *
  • Posts: 9
Random Colors on Random Bouncing Cubes.[SOLVED]
« on: August 15, 2014, 08:54:10 PM »
Hey there, first time here. I was following this tutorial right here , and now i'm trying to have colors randomly show up on whichever cube was picked to bounce. I've gotten it to work somewhat, but some of the cubes get stuck inside one of my states("switch state"), and therefore no longer work. Overall I used the same technique from this tutorial in order to change the colors. The only thing I did differently was replace "set int value" with "Random Float" and an "int switch" with a float switch. So whichever number Random Float picked out, I wanted the float switch to send an event to that corresponding color. I thought It would work but it didn't. What is the right way to do this?
« Last Edit: August 18, 2014, 03:58:08 AM by jeanfabre »

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Random Colors on Random Bouncing Cubes.
« Reply #1 on: August 15, 2014, 09:16:27 PM »
Can you post a screenshot of your FSM and it's states/actions?

swc220

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Random Colors on Random Bouncing Cubes.
« Reply #2 on: August 15, 2014, 10:02:52 PM »
Ok so, my camera's not that great but I attached 2 pics. one of the "switch state" that has all the actions in it, and one of the overall layout, though you can't see it too well. The layout is pretty much the same as the Popup Manager tutorial, except for the "switch state", the colors it transitions to depending on the random float, and a "Reset Color" state I used to set the color back to normal before it went to the listener again. So its Listener -> Switch -> (4 different colors with a set material action) -> Pop (cube jumping) -> Reset Color -> Listener

*added 1 more to show the set material float I used for the Pop state..
« Last Edit: August 15, 2014, 10:59:17 PM by swc220 »

swc220

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Random Colors on Random Bouncing Cubes.
« Reply #3 on: August 15, 2014, 11:38:44 PM »
Ok, So I think I got it to work by creating a new state and using an action called "Select Random Color", and then just using a variable its stored in for the color material. Definitely not as complicated as I thought it would be.

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Random Colors on Random Bouncing Cubes.
« Reply #4 on: August 16, 2014, 04:11:21 AM »
Glad you got it sorted.

FYI -  Windows has a built in tool  called Snipping Tool  for grabbing screen images, there's no need for a physical camera in 2014 :) 

swc220

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Random Colors on Random Bouncing Cubes.
« Reply #5 on: August 17, 2014, 01:23:58 AM »
noted* it never even occurred to me ;p