Skip to content

Commit

Permalink
[Fix] Bullet x/y wrong position if the bullet is parented to somethin…
Browse files Browse the repository at this point in the history
…g else
  • Loading branch information
RhenaudTheLukark committed Oct 29, 2023
1 parent cdd001f commit ae751bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Scripts/Lua/CLRBindings/ProjectileController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public ProjectileController(Projectile p) {

// The x position of the sprite, relative to the arena position and its anchor.
public float x {
get { return p == null ? lastX : p.self.anchoredPosition.x - ArenaManager.arenaCenter.x; }
get { return p == null ? lastX : p.self.position.x - ArenaManager.arenaCenter.x; }
set { MoveTo(value, y); }
}

// The y position of the sprite, relative to the arena position and its anchor.
public float y {
get { return p == null ? lastY : p.self.anchoredPosition.y - ArenaManager.arenaCenter.y; }
get { return p == null ? lastY : p.self.position.y - ArenaManager.arenaCenter.y; }
set { MoveTo(x, value); }
}

Expand Down

0 comments on commit ae751bd

Please sign in to comment.