- Home /
Question by
paulll01 · Jul 10, 2018 at 02:40 PM ·
unity5jointscannonball
How can I add Sprinj Joint after it has been destroyed ?
I am launching a ball and when it leaves the Basketball Hoop the Spring Joint is Destroyed. The problem is when the ball comes back i can't launch it again because I have Spring Joint no more .... Please help me I am new to this... I'm working on 2D
Here is the part where cannonball is launched:
void Update () {
if (clickedOn) {
Dragging ();
}
if (spring != null) {
if(preVelocity.sqrMagnitude > rigidBody.velocity.sqrMagnitude){
Destroy (spring);
rigidBody.velocity = preVelocity;
}
if(!clickedOn){
preVelocity = rigidBody.velocity;
}
}
}
Comment
Your answer
Follow this Question
Related Questions
2d cannon bullet 2 Answers
Browser communcation from js to unity in WebGL 0 Answers
Unity 5: "Run API updater" greyed out, does it require MonoDevelop? 1 Answer
AudioMixer Script Not working ios 64bit build 0 Answers
Once more with the Aspect Ratio's 1 Answer