From c76f64d6501591b5f75b6869a11dea4b58fb8586 Mon Sep 17 00:00:00 2001 From: gameegg Date: Sun, 22 Jan 2017 16:09:50 +0900 Subject: [PATCH] ship collider bug fix --- Assets/Scripts/Game/ShipUpdator.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Game/ShipUpdator.cs b/Assets/Scripts/Game/ShipUpdator.cs index 1957925..38e339a 100644 --- a/Assets/Scripts/Game/ShipUpdator.cs +++ b/Assets/Scripts/Game/ShipUpdator.cs @@ -107,9 +107,10 @@ void UpdatePosition() var speed = !_ship.isCharging.value ? _ship.spd : Mathf.Min(GameConsts.maxShipSpd * GameConsts.chargingMoveSlow, _ship.spd); - var position = transform.position + (transform.rotation * Vector3.right * Time.deltaTime * speed); - transform.position = position; - //_rigidbody.MovePosition(position); + var dp = (transform.rotation * Vector3.right * Time.deltaTime * speed); + Vector2 position = _rigidbody.position + new Vector2(dp.x,dp.y); + //_rigidbody.position = position; + _rigidbody.MovePosition(position); //var position = transform.position + (_ship.rot * Vector3.right * Time.deltaTime * speed); //Debug.Log(_body.Position);