Game Development Community

Shooting a ball

by Gianluca Balzano · in Torque X 3D · 04/29/2010 (8:21 am) · 1 replies

Hey everyone,
I'm trying to write a component to make my game character actually "Shoot" a soccer ball. I know I'm going to have to play with the ball's friction and velocity to make it happen, but I'm not quite sure what to do after that. Any help would be appreciated.

#1
05/01/2010 (12:49 am)
Alright I know that was a bit vague...but now since I somewhat know what I'm dealing with I might be able to elaborate a bit more. I created a T3DRigidComponent on the ball, and added a new velocity to it. Now that seems to actually work. When I hit the assigned button, the ball will react. Now this leads to a problem.

The ball seems to be taking world coordinates, as opposed to the object's coordinates, so it will only go in one direction. Is is because the T3DRigidComponent uses world coordinates? I'm not quite sure on what to make of it. I considered using the T3DRigidConstraintComponent to bind the ball to the player, but I haven't a clue on how any of that works. Can anyone help break down the T3DRigidConstraintComponent for me? Any help will be greatly appreciated.