I want to create a King Slime that spawns Slime after reaching 30 health. The spawn system works well but when the slime was spawned, it’s not moving at all. The slime will move by changing its variable Movement to 1 to 4 randomly and every number corresponds to different angles for variety and that part is the problem.
When you spawn the slime, you need to “Link two objects”, not “Take into account linked objects”
Yeah! I didn’t realize that I use take into account instead of link. I’ve change it but there’s another problem. Some slimes have movement randomly based on my events 1 to 4 but some slimes didn’t move. I don’t know why some slimes didn’t move even if the event change their variable to 1 to 4 randomly and each number corresponds to a force.
I think the problem occurs because of the trigger once. When the first slime triggers the
Movement of Slime = 1 condition, that action will get run once. When the next slime is created with a Movement of 1, it won’t get actioned because the trigger condition is still true.
Am I correct in assuming you want the slime to fire off at a random 45 degree angle? If so, maybe change the events so that you have a sub event straight after the one where you create the slime. In that have no condition, and the action
Add to Slime a permanent force, angle (RandomInRange(0, 3) * 90 + 45) degrees and length: 90 pixels.
That’ll remove the need for the last 5 events in your first screen shot.
That’s a great idea but I found lately the solution. I just put the change variable Movement event under the Slime Spawn event and put the 4 Movement events under the change variable Movement event. So that when the time reaches 3, it activated all events to one specific slime because it takes account the link and that specific slime can only give the movement permanently and can’t affect other slime. But thanks for the idea!