playMaker

Author Topic: Help with power UPs  (Read 1946 times)

Earthbasedhuman

  • Playmaker Newbie
  • *
  • Posts: 3
Help with power UPs
« on: November 15, 2016, 06:59:53 AM »
Hello.
Im super new to both Unity, Playmaker and coding in general so still trying to get my head round everything. Any help would be appreciated greatly. Im trying to add a simple speed boost pickup to my scene, whereby when the player moves over the power up object, the player receives a temporary speed boost.

I have made the power up destroy itself and create a sound effect on collision which works well.
 
At the moment the FSM flows through these states:
Start > Set Float Value (Named PlayerSpeed) > A Trigger Event when the player collides with the object  > GetGameObject speed (set to PlayerSpeed), Float add (to float variable PlayerSpeed)

Attached a screen grab of where I think this has all gone wrong in the final state.

Thank you.
 :)

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: Help with power UPs
« Reply #1 on: November 15, 2016, 12:38:19 PM »
So, where exactly does it not work... On the last state? And what happens exactly in-game?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help with power UPs
« Reply #2 on: November 16, 2016, 04:01:45 AM »
Hi,

 can you put a screenshot of actions of each states?

 Bye,

 Jean

Earthbasedhuman

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Help with power UPs
« Reply #3 on: November 16, 2016, 12:20:47 PM »
Hey Jean & Elusiven.
Thank you for the reply.
There is no effect to the speed when the playerobject collides with the pickup and the FSM doesn't seem to fire or recognise the collision when the playerobject moves over the pickup. It does recognise a collision in another FSM attached to the pickup that creates a sound though.

Iv attached this FSM to the playerobject not the pickup.

Thanks for your help.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help with power UPs
« Reply #4 on: November 17, 2016, 03:20:49 AM »
Hi,

 First of all, NEVER use the system events in custom actions, it's definitly going to trick you.

so , don't use FINISH as an event within an action, FINISH is a reserved Event that is called when all actions finished their execution for a given state.

 so replace all your finish transition with a proper dedicated custom event and test.

 Bye,

 Jean