spawn actor goes in the player direction
emoji
Member, BASIC Posts: 66
Hello, would someone assist with this issue? below is my player behavior.
and this one is my projectile actor behavior aka power
so my player can move left and right just fine when I press this button it shoots power but I just notice that (when facing right or vice versa) once I shoot and then decided to move left, the power will move left just like the player. I'm trying to figure it out but if someone has experience with this before please share. thank you.
Comments
What happens if you turn off ALL of the rules & behaviors in the power actor except that Move behavior? And then what happens when you turn of the Move behavior as well?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
update I think I found the problem but I don't know how to solve the problem. so basically my player behavior has two attributes. the walkRight will change to false when I move left and I think this cause my power to move left and the shoot will only become true when I press the button. I hope this would give some more details for helping to solve this problem.
It's not really clear from the screenshot you posted because it doesn't show how those attributes are changing value.
You may want to upload your project file (.zip it first) so that all of the rules are visible.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
hi, I can't upload the project cause it will give away my secret but basically when user press button to walk left or right the attribute walkLeft or walkRight will be true( it one or the other) and when the user press the shoot button the shoot will become true and become false after release. for example when the player is walking right and I press the shoot button then the player will shoot power out and then if I decided to move the player left after I shoot the walkRight will become false and the power will shift its move directly to the left. Im gonna recreate this sample sometime tonight and upload here once I get home from work.
I don't really understand exactly what your issue is. Something about when your player shoots?
On a side note...shouldn't there be three options? Walkleft is true when going right, false when going left, but how about when not moving? Using integer attribute could easily solve this, if you even want to, by just using 0, 1, and 2.
A file would be nice to look at.
I kind of solve the problem. I put a timer on the shoot and walkRight. it is enough time for my power to hit the enemy or exit the screen and get destroy. so that way when my player decided to walkLeft after shooting the power still travel opposite the player direction.
If it works, it works.
I think i have a thought on this... ah yes, there it is. Perhaps and accelerate toward instead of move the shot. Put it in a timer for a second and check run to completion. You can also put a max speed on the shot if it goes too fast. That run to completion should make the shot continue toward right or left.