playMaker

Author Topic: Compare actions to include a within range  (Read 3122 times)

HeathClose

  • Full Member
  • ***
  • Posts: 226
Compare actions to include a within range
« on: January 27, 2017, 08:52:07 PM »
I could really use another option on a float compare action right now... we have equal, less than, greater than... but what I really need right now is Within...

I'm spawning two objects near each other, and if their Y values are within a certain range, I want it to pick a new Y value to spawn at... so within would have a space to input a number, say 3... and if the comparison comes within 3, send an event to choose another Y value.. this would keep objects from being right next to each other...

Is this already achievable?  Is this easy enough that someone could cook this up real quick?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Compare actions to include a within range
« Reply #1 on: January 28, 2017, 06:20:58 AM »
Hi,
maybe you can use 2 float compares?  For example in the 1st compare only greater than 1, then in the second compare only less than 5. and set the state as sequence (right click and select the Action sequence option at the top)

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Compare actions to include a within range
« Reply #2 on: January 28, 2017, 06:21:53 AM »
there is an action called float difference, you can use that

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Compare actions to include a within range
« Reply #3 on: January 28, 2017, 06:31:10 AM »
there is an action called float difference, you can use that

Hmm... is it on the Ecosystem?
I can't seem to find it.

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Compare actions to include a within range
« Reply #4 on: January 28, 2017, 09:54:07 AM »

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Compare actions to include a within range
« Reply #5 on: January 28, 2017, 09:58:39 PM »
thank you that float difference works perfectly