Proper script to use for teleporting the player after entering a region?

So I am making a game that requires me to create a region that, when entered, the player gains score and is subsequently teleported back to the spawn location.

My script goes likes this:

Triggers: when a unit enters a region

if ((last triggering region)) == (score1)
then do:

  • set player attribute Score of (owner of (last triggering unit)) as (((Score of (owner of (last triggering unit)))) + (((1) * ((Rebirth of (owner of (last triggering unit)))))))

  • teleport (last triggering unit) to (random position in Spawn) without interpolation (instant unit + camera movement)

However, it doesn’t work very well. (See in reply.)

1 Like

I flagged the post that isn’t relevant to the topic.

1 Like

Script triggers twice/gives score twice. Occurs more when it lags more or when the player is moving faster. Walls are around it from 3 sides. The region is about the size of a tile and it is beside a map boundary. Let me know if this might be a bug or what I might have to do to fix it.

(Removed other replies I made because I wanted to simplify it.)

I believe the issue may be a bug with it since I tried the teleport script with an item and had no issue. It also does not have anything to do with the walls. Or it is as a result of lag. Do I make a bug report perhaps?