playMaker

Author Topic: Faster response time  (Read 2860 times)

dougbello

  • Playmaker Newbie
  • *
  • Posts: 32
Faster response time
« on: July 03, 2015, 04:40:08 PM »
Hello,

I'm making a jumping character game...

On the main character I have 2 FSMs, one for run and other for jump.

On the jump, I'm testing if it is on the ground before it jumps, but I'm experiencing a bit of a lag with this system... i'm ataching images with my way of doing it. :o

So maybe there is a better, faster way of doing this setup. When i go directly from touching to jump, its really fast, but when i check if it is on the floor, it laggs.

Any ideas?

Doug.

DarkSoul

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Faster response time
« Reply #1 on: July 03, 2015, 05:49:37 PM »
Why waiting action?

Use on collision Exit and on collision enter it is better.


And you can make the actions execute sequentially by right clicking on empty area of the actions and choose action sequence .

dougbello

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Faster response time
« Reply #2 on: July 03, 2015, 08:33:38 PM »
Thanks DarkSoul,

But I'm using the wait in there as an option in case its not in the floor... how should i send the action to not in the floor without the wait or something else?

And for the test I need to know if it is on the floor.. its not on collision stay? How can I use on collision enter and exit when its on the floor?

Thanks again.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Faster response time
« Reply #3 on: July 04, 2015, 06:32:57 AM »
maybe these tutorials can help you.
check out part 2 moving platforms.
its 2d but should work the same way in 3d.

DarkSoul

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Faster response time
« Reply #4 on: July 04, 2015, 11:12:54 AM »
Your Welcome , :)
First:
Make a global bool variable [isgrounded] and when user clicks jump you >> check if bool is true or false >>
if true >> set velocity and set bool to false
if false >> loop
Second:
And on the floor
>> make fsm
>>make trigger collider
>>on collision enter set [isgrounded] to true every frame

You can make a template or a prefab of the floor fsm and simply add fsm template.

I hope it helped. :D