From 741bb7fbc043c2172e7f9a92e5085bcff3ec9dfb Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Tue, 25 Apr 2023 16:33:31 +0200 Subject: [PATCH] fix null pointer error --- Assets/Scripts/Game/Ball.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Game/Ball.cs b/Assets/Scripts/Game/Ball.cs index 31e7343..b5c2f03 100644 --- a/Assets/Scripts/Game/Ball.cs +++ b/Assets/Scripts/Game/Ball.cs @@ -4,7 +4,7 @@ using UnityEngine; namespace Game { public class Ball : NetworkBehaviour { - private float SpeedGain { get; } = GameManager.BalanceValues.ballSpeedMultiplier; + private float SpeedGain { get; set; } public Rigidbody2D Rb { get; private set; } @@ -22,6 +22,7 @@ namespace Game { private void Awake() { Rb = GetComponent(); Collider = GetComponent(); + SpeedGain = GameManager.BalanceValues.ballSpeedMultiplier; } private void OnCollisionEnter2D(Collision2D other) {