# Point with offset!?

#### Firsk

Level 3
I've been playing around with distance to target, and I can't understand this one...
The idea, is a TD with "preset" selectable dummies.

But for some reason, the distance gets all weird, and each player gets different results!?

For Player 1, the above tower is removed.
Player 2 lacks the tower positioned to the right.
Player 3 is missing both up and right.
Player 4 works fine...?!

The "code" is identical in all directions (except for degrees).
The terrain is flat and buildable.
The collision is less than distance.

I've also noticed that if I disable the remove-trigger, the tower is 1 grid further.
So I'm guessing that grid/distance is the problem?

The idea is to get a tower in each direction, with 1 grid-space between them.

Last edited:

#### FeelsGoodMan

Level 41
You should choose degrees the offset should be offset by. Now it's always set to 0 so the first unit you create will be created to the east, then the next one will be created at the same location. This will mess up the locations due to collision sizes etc.

I'm not sure if you meant that the code is 100% identical or not, but if you have the same code for all tower spawns, but changed the degrees then just ignore this.

Last edited:

#### Firsk

Level 3
You should choose degrees the offset should be offset by. Now it's always set to 0 so the first unit you create will be created to the east, then the next one will be created at the same location. This will mess up the locations due to collision sizes etc.

I'm not sure if you meant that the code is 100% identical or not, but if you have the same code for all tower spawns, but changed the degrees then just ignore this.

lol yes, the point is changed from the center with degrees for each tower ;P

#### Pyrogasm

Level 36
There's probably a rounding error so it's not being offset by exactly 192. In this case I would actually use "point with offset" rather than "point with polar offset". Offset by +-192 in x or +- 192 in y depending on which tower you are creating.

#### Firsk

Level 3
There's probably a rounding error so it's not being offset by exactly 192. In this case I would actually use "point with offset" rather than "point with polar offset". Offset by +-192 in x or +- 192 in y depending on which tower you are creating.

Yeah apparently polar offset fudged it up, because "offset by x/y" seem to have fixed it.
Now I'm a bit irritated that I didn't think of testing that before asking about it here! xD

Thanks Pyrogasm.

Replies
2
Views
2K
Replies
4
Views
549
Replies
6
Views
460
Replies
18
Views
1K
Replies
12
Views
611