playMaker

Author Topic: comparing variables consistantly  (Read 550 times)

kinetiknz

  • Junior Playmaker
  • **
  • Posts: 85
    • View Profile
comparing variables consistantly
« on: January 25, 2015, 07:32:32 PM »
Hi there, I have an FSM system that compares - camera.z to another - camera.z increases all the time, then when they match a wave of obstacles spawn.

I am using float compare to check for the match, with a tolerance of '4' then sending spawn events.

Every time I run the game, it reaches a different length before failing to spawn (match the variables) - this worries me as it's inconsistent.

I am wondering.. Can another action combination replace this that doesn't need tolerance and will trigger exactly when the variable reaches a certain figure?

tweaking the tolerance variable until I get the longest amount of time before failure doesn't seem like it can be the best development method.

« Last Edit: January 25, 2015, 07:48:12 PM by kinetiknz »