Ok man. I need help. Im trying to make a game where the enemy follows the player. but only on the x-axis. like when my player jumps, the enemy starts to float toward them. i want to make it where it only follows you on an x-axis. so if im in the air, the enemy will be below me, trying to get to me but not able to go up. Get what im sayin? Can you tell me how?
Offline
Ok, on the enemy, set a script saying
When Green Flag Clicked
Forever:
Set X To (Xposition0 of (player)
Last edited by GirWaffles64 (2010-04-06 22:05:43)
Offline
Try this
forever{
if (targetX>xposition){
change x by 10}
else{
change x by -10
}
}
Offline
what does it mean by "target"?
Offline
ok. exactly what i mean is: for example, these pieces
<move( )steps>
<point towards(
EXCEPT i dont want it moving on the Y-axis WHATSOEVER i still want it to follow me at a controlled speed, just not having the ability to move up or down
Offline
DisposableHero wrote:
what does it mean by "target"?
Replace target with whatever you want to follow. The script will follow its target on the x axis at a controlled pace.
Offline
Wait. Can you rewrite your example script please? I dont quite understand what i need to do...
Offline
Its really really basic
Offline
okay. i did that and it works. thank you. but one more problem. the enemies are starting at places i did not intend them to start at. i even forced them to go to a certain spot but they keep overriding it 0.o
Offline
DisposableHero wrote:
okay. i did that and it works. thank you. but one more problem. the enemies are starting at places i did not intend them to start at. i even forced them to go to a certain spot but they keep overriding it 0.o
Did you get X and Y mixed up? That happens to me sometimes
Offline