playMaker

Author Topic: send message issue when working with simple sprite pro or free edition[SOLVED]  (Read 2091 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Simple sprite free edition: http://u3d.as/content/black-rain-interactive/simple-sprite/3vY

I am using the Axis event extended 8 ways direction. http://hutonggames.com/playmakerforum/index.php?topic=4516.0

In order to play an animation you need to Broadcast message ("PrePlay")

Then to specify what animation to play,

Broadcast message ("PlayAnimation", animation number).


My problem is on this second send message.

Send message action.

use owner, Broadcast Message, Don't require receiver

Method name PlayAnimation.

Parameter I am using an Int which I set to my chosen animation number.

I get a unity error "Divide by Zero exception".

I also tried to use a Float but get the same error.

I am no coder but the simple sprite java script code uses an Int already possibly that's the issue.

I have been testing and it seems the issue lies when pressing both keys.

I am using the Axis event extended 8 ways direction. http://hutonggames.com/playmakerforum/index.php?topic=4516.0

But do not know how this works could it conflict with the simple sprite code?

Help welcome
« Last Edit: December 05, 2013, 02:53:33 PM by colpolstudios »

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: send message issue when working with simple sprite pro or free edition
« Reply #1 on: December 04, 2013, 05:18:49 PM »
Awaiting answer

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 This is to do with your logic actually.

 Basically, you are calling a function that use your variable for a division, and expect to divide a number with it, and you are likely passing 0 or a value that leads to a division by 0.

you should check for the offensive value you pass and prevent calling the method if you detect it.

Can you paste the full error, it will likely say what script is complaining.

bye,

 Jean