I’m making a game where one of the attacks the character uses is a fireball. when I first made it, the fireball would shoot forward only, and would hit the character itself when my character was facing left. So I made a mailbox message system so that whenever my character faced left, a message would be sent to the fireball to rotate it 180 degrees so it would shoot towards the left. however, even though I named both message and mailbox the same thing, and made sure the message would send to the fireball object, the fireball object never seemed to receive the message. what is going on?
There are several things you can try:
-
Make sure the message is sent after the emit object is used (using the emit output).
-
Retype the message and mailbox, even adding a space at the end of the message will make them mismatch.
-
Send the value into the “emit” input. The the fireball can get the value from the extractor behavior set to “starting value”.
Sorry, but I’m a bit confused. The message is not connected to the emit in any way at all. The message rotates the fireball 180 degrees when the character is facing left, so the fireball moves in the backwards direction instead of hitting the character. The emit only happens when the fireball is used. The problem is that the message I’m sending from the player object never seems to reach the fireball object. I can confirm this as the code blocks in the player activated when my character turned left, while the code blocks in the fireball didn’t. Also, I checked and both message and mailbox are the exact same name.
if you give us a game link, we can better understand what is happening.
Maybe you are sending the message to a specific object, not all fireballs?
Also you can just click “rotate objects” to point the objects in the directoin fired.
Im saying it should be after emit, if you send the message before emit, the message would never get to the fireball because it doesnt exist yet.
You could also use the extract method I mentioned instead.