- Home /
How Do I make it harder to move rigid body?
In my game I Have a castle made out of rigid body blocks. I don't want to knock down the blocks using my musket but I want to with my cannon
So how do I Make it so rigid bodys wont move as much?
Javascript only please.
One possible way is to increase the mass of the blocks in the castle, or to reduce the mass of the musket ball.
Answer by Neel-Frost · Jun 17, 2014 at 06:07 AM
Trying adding mass to the Rigidbody and then lower the power of your musket and then the increase the power of your cannon ball. And for physics you can use metal for the Rigidbody blocks.
There's no setting for "power." All you have are mass and speed (and you can't change the speed, since it has to look right.) Even if you fire the balls with AddForce, it just divides mass by the force and sets speed.
By "metal," I assume you mean a premade Physics material. Those are really for how much you bounce and slide on the ground, after the bullet has knocked you off the wall. But, yes, using a higher static friction will make the blocks ignore small hits.
Well, I cant change the speed saying if I do my musket ball will simply go 2 feet forward and hit the ground.
And even unity says "You should strive to keep mass close to 0.1 and never more than 10. Large masses make physics simulation unstable" So what do I do can I script something?
Playing with mass is the way to go. If you'd read the line above you would have noted that "Higher mass objects push lower mass objects more when colliding."
Some actual numbers to use (from google)
Cannonball mass anywhere from 2 to 20 $$anonymous$$usketball mass around 0.3
Put these numbers in and the physics should work fine.
Asking to do your own script is not going to get much luck. Writing a physics engine can be complicated and is not what you want to spend your time doing, especially when the existing engine can do the job.
@Owen Reynolds By power i meant to say the the cannon ball forward speed when it is instantiated.
Your answer
Follow this Question
Related Questions
Launching player with cannon 2 Answers
How to make foot don't cross the ball? 0 Answers
Raycast On Rigidbody 1 Answer
AddExplosionForce doing nothing? 1 Answer
Rotation problem with spawning bullet 2 Answers