Skip to content

Commit ae74d19

Browse files
authored
WeaponManager: Fix weapons not working on Desktop (#204)
1 parent 72d59ac commit ae74d19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CopsAndRobbers/Assets/Scripts/PlayerScripts/PlayerAttack/WeaponManager.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ private void Update()
229229
private void setAttackParams()
230230
{
231231
mousePosition = GetMouseWorldPosition(); // +new Vector3(-0.5f, -0.2f, 0);
232-
233232
//#if UNITY_STANDALONE || UNITY_WEBPLAYER
234233
mouseDir = (mousePosition - transform.position).normalized;
235234
//#elif UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_IPHONE
@@ -352,7 +351,8 @@ public void RpcPlayGunShotSound()
352351
/// <returns>A Vector3 With the relative mouse position</returns>
353352
public Vector3 GetMouseWorldPositionWithZ(Vector3 screenPosition, Camera worldCamera)
354353
{
355-
return Camera.main.ScreenToWorldPoint(Mouse.current.position.ReadValue());
354+
Vector3 mousePos = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 1.0f);
355+
return Camera.main.ScreenToWorldPoint(mousePos);
356356

357357
}
358358
#if UNITY_STANDALONE || UNITY_WEBPLAYER

0 commit comments

Comments
 (0)