Question by
Creative Inventory · Dec 13, 2015 at 11:53 AM ·
2daddexplosionforce
AddExplosionForce help?
I want to change my script into a 2D c# script. I know that AddExplosionForce is not a member of UnityEngine.Rigidbody2D so how can I change this in to a 2D script and still have the same force applied fro all directions. (basically do the same but in 2D) Thank you! Here's my script:
# pragma strict
var explosionStrength : float = 100;
function OnCollisionEnter(_other: Collision)
{
if (_other.collider.gameObject.name == "Bouncy object")
_other.rigidbody.AddExplosionForce(explosionStrength, this.transform.position,5);
}
Comment
Your answer
Follow this Question
Related Questions
Camera vertically scrolling effect (scroll out) 1 Answer
Multiple Sprite Pivot Points 0 Answers
I can't do jump in my 2D game 1 Answer
Unity Android build multiplying decimal numbers by 10 for an unknown reason 0 Answers
[2D] Updating PSB I had previously rigged and animated BREAKS entire rig 0 Answers