Rigidbody

 
Post new topic   Reply to topic    Unity Community Index // Unity Support
View previous topic :: View next topic  
Author Message
anur_p



Joined: 27 Oct 2009
Posts: 2

PostPosted: Sat Nov 07, 2009 12:11 pm    Post subject: Rigidbody Reply with quote
Hi,
I am new to 3d Gaming and need to know a basic thing.

I want to rotate an object (say a pedal ) about a fixed point and make it hit a ball which should then fly off in a direction and with a speed which is in accordance with laws of physics.

In Unity3d what I have done is attached a sphere collider and a rigidbody to the ball and a mesh collider and a rigidbody to the object (the pedal) with gravity turned off on it.

I call a transform.rotate() on the object whenever I want to hit the ball (and then bring it back to the original position in the next frame), but this only makes the object treat the paddle as a static collider in the new rotated position and disregards all interactions vis-a-vis the physics.

For the expected behviour do I have to apply a torque to the paddle to make it rotate ?

Thanks
Anur
Back to top
View user's profile Send private message Yahoo Messenger
andeeee
Forum Moderator


Joined: 19 Jul 2005
Posts: 1603
Location: Blackpool, United Kingdom

PostPosted: Mon Nov 09, 2009 5:47 pm    Post subject: Re: Rigidbody Reply with quote
anur_p wrote:
For the expected behviour do I have to apply a torque to the paddle to make it rotate ?

Yes. Generally, you don't get the expected physical behaviour when you move rigidbody objects by setting their position rather than moving them with forces and torques.

_________________
None of you understand... I'm not logged-in here with you - YOU'RE LOGGED-IN HERE WITH ME!
Back to top
View user's profile Send private message
Post new topic   Reply to topic    Unity Community Index // Unity Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum