I made a weapon and it shoots, but how do I shoot it to the left and right depending on the direction of the player?
Can you send the link to your game?
I have this same issue on first game but there coded the same
To do this, we have to make the magic wand know which direction the player is facing. Some simple code that handles this is this:
This code sends ‘flip’ or ‘back’ to all attached objects (the magic wand).
Now to change the direction of the shooting.
In emit, there is a part called ‘angle’. This changes the angle of where it emits. The default is 0. We need to change it depending on the way the player is facing. So, when the player flips, it sends the message flip to the wand. Now we need to emit the other way. So, on recieving the message, we will set the angle to 180. When the player turns back, it should go back to 0.
Here is that code:
Hope this helped!
Thank you so much, I never understood mailboxes at first but now I see the simplicity and why I need to use it more!!!
Just remember that it is case sensitive.
Quick question have you tried level 1 or did the secret get revealed when coding?