I am making a platform scrolling shooter with projectiles. The enemy has to keep moving sort of like Mario enemies. But I need it to stop moving when it is shot. Here is the script I hope that's all that is necessary.
Offline
Do you have a script somewhere else that's setting enemymove to 1?
Offline
Does it carry on moving forever or just for about 5 seconds? If it's just for about 5 seconds, then it's almost certainly because of the repeat block. If you put a repeat x times inside an if, then even if the statement in the if turns false, the script inside the repeat will carry on until it's finished the script the specified amount of times.
I hope that made sense, I'm not the best at explaining things!
Offline
I believe the problem is that the bullet it hitting the sprite while the sprite is running its movement script. The script only checks if it is touching a bullet once every 40 frames (approximately). You need it to check every frame. Does that make sense?
Your script:
Am I touching bullet?
Move forward
Move backward
Am I touching bullet
Move forward
Move backword
etc.
It only checks if it is touching a bullet once a cycle.
Offline
MoreGamesNow wrote:
I believe the problem is that the bullet it hitting the sprite while the sprite is running its movement script. The script only checks if it is touching a bullet once every 40 frames (approximately). You need it to check every frame. Does that make sense?
Your script:
Am I touching bullet?
Move forward
Move backward
Am I touching bullet
Move forward
Move backword
etc.
It only checks if it is touching a bullet once a cycle.
Yeah, that's sort of what I was saying.
Offline