|
|
@ -142,7 +142,7 @@ public class magnetGun : MonoBehaviour { |
|
|
|
if (item.tag == "moveable" && Input.GetButtonDown("Quick Push")){ |
|
|
|
Vector3 direction = (transform.position - item.transform.position).normalized; |
|
|
|
|
|
|
|
item.attachedRigidbody.AddForce(direction * impulsePower * maxPullSpeed,ForceMode.Impulse); |
|
|
|
item.attachedRigidbody.AddForce(direction * impulsePower * maxPullSpeed* item.attachedRigidbody.mass,ForceMode.Impulse ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -185,7 +185,7 @@ public class magnetGun : MonoBehaviour { |
|
|
|
maxPull = camera.transform.position + (camera.transform.rotation * Vector3.forward); |
|
|
|
|
|
|
|
|
|
|
|
if (Vector3.Distance (gravityWell.transform.position, camera.transform.position) > minDistance || maxPullSpeed<1) { |
|
|
|
if ((Vector3.Distance (gravityWell.transform.position, camera.transform.position) > minDistance && Vector3.Distance (gravityWell.transform.position, camera.transform.position) < magnetRange) || maxPullSpeed<1) { |
|
|
|
gravityWell.transform.position = Vector3.MoveTowards (gravityWell.transform.position, maxPull, step); |
|
|
|
|
|
|
|
if ((Vector3.Distance (gravityWell.transform.position, camera.transform.position) > magnetRange) && !topScreen) |
|
|
@ -219,7 +219,7 @@ public class magnetGun : MonoBehaviour { |
|
|
|
public void cameraRotateTest(Collider item){ |
|
|
|
|
|
|
|
if (item != null) { |
|
|
|
Debug.Log ("distance test: " + Vector3.Distance (gravityWell.transform.position, camera.transform.position)); |
|
|
|
//Debug.Log ("distance test: " + Vector3.Distance (gravityWell.transform.position, camera.transform.position));
|
|
|
|
if (Vector3.Distance (gravityWell.transform.position, camera.transform.position) <= minDistance) { |
|
|
|
playerController.cameraSpeedX = 250.0f; |
|
|
|
playerController.cameraSpeedY = 120.0f; |
|
|
|