This is the third time I’ve tried to post this here.
I’m trying to fling an object(voxel ball I created) in the correct direction, and have it rotate in the direction it is spinning, when it hits colliders (see idea2.png screenshot), it bounces off.
I’ve posted a little running gif using “screen to gif”, that shows what the object is doing, I think I have the flinging part working fine, but I have no clue as to how to do the rotation(23+ years since this type of thing and i did do it anyways)
I’m pulling my hair out with this, and I’ve not go much let anyways, Here is my code so far fling and everything.
Any advice on this matter would greatly be appreciated.
One way is to put the voxel graphics inside a sphere collider and just let the physics drive the sphere’s rotation. Unless you make the PhysicMaterial very slippery, it should feel much like a rolling ball bouncing on a wall.
Remember, the inertia of the roll will be transferred and change the angle of bounce so that it won’t be a clean bounce each time once you do this.
Thank you for taking the time to reply, The voxel ball is currently in a sphere collider and has a material that has full bounciness e.g set to 1, I’ve just set the bounciness down to 0.5, and it feels no different.
Could I use the Quaternion.LookRotation to rotate the ball to at least look in the correct direction?
I still want it to spin in the correct direction though.
maybe you can put together a little demo to show my what you mean, if that’s not to much trouble.
I’ve been pulling my hair out on this for several days.
The spinning is going to be more a function of the drag. If you have the drag set to nothing on the physicMaterial, then it will slide like ice on ice. If you have it set higher, it will act more like a billiard ball on a table.
Also be aware of the difference between static and dynamic (kinetic) friction.
Static friction determines how much force you need to push a still object and move it, while kinetic friction is the force pushing against a moving object.
Close… static friction is when the two surfaces are not moving relative to each other, i.e., like a car tire rolling along the ground, or as the case you said, an object that is at rest.
Dynamic friction is when the surfaces are sliding over each other.
Obviously in real life there is also a band of hysteresis as the relative speed is near zero and surface deformation comes into play, causing the actual relative speed to oscillate between zero and nonzero.
This is what you hear with tire chatter when you brake or accelerate really hard. (And when it is not the car’s ABS or other traction control software operating!)
Sorry for the late reply, I’ve added you both in this post because you have been so kind to reply, I’ve still not go it working, but here is what I’ve done, so you might be able to guide me more.
First I now have two physics materials, (Bounce is forthe Ball, and Collider_Bounce is for the wall edge colliders if you want to call them that.
Bounce
Dynamic Friction: 200
Static Friction: 0
Bounciness: 1
Friction Combine: Average
Bounciness Combine: Average
Collider_Bounce
Dynamic Friction: 175
Static Friction: 0
Bounciness: 0.75
Friction Combine: Average
Bounciness Combine: Average
What happens is the Ball does bounce ok but after a couple of collisions does not rotate anymore, although it ONLY rotates on a single angle from Left to right not forward to backwards.
I’ve not set any angular drag or drag on the balls rigidbody.