Newbie question
by Tim Mosier · in Torque Game Engine · 06/19/2008 (3:35 pm) · 3 replies
Alright, heres what I want to do. I have a custom character and all the animations for a platform shooter. What I want to do is have the characters arm point in the direction of the mouse. And an object that is the players gun arm, linked to the body, to pivot up and down at the angle of the pivot point on the body and the mouse; and the bullets to travel along the same linear path. I realize this is going to be quite a task, but let me know where is best to begin.
#2
Also, I have been searching the forums for information on a mouse targeting system but havn't found any. If anone can remember specifically where, and give me direction, it would be much appreciated.
06/19/2008 (6:06 pm)
By blended animations do you mean something like transition animations between varying angles that are called by reference with the mouse targeting system? Basically a frame for each angle or each couple angles? I was hoping there was some way to literally rotate the object around a specific point and that angle would be references to the bullet's direction as well. I was curious about math functions in Torque as well. My first thought was that I could determine an angle by something like angle = atan((mouse.y - player.y)/(mouse.x - player.x))... Then I figured if I wanted my bullet speed to be say 300, I could just do somethign like linearVelocityX(sin(angle)*300) and linearVelocityY(cos(angle)*300) and such. even if I had to use something more complex like rotation matrices even. I am fairly new to coding, just started school for game and simulation programming where we use Torque. Also, I have been searching the forums for information on a mouse targeting system but havn't found any. If anone can remember specifically where, and give me direction, it would be much appreciated.
#3
The AFX system has a mouse/cursor targeting system.
Quote
Powerful Constraint System
Independently constrain the position and orientation of any effect to other scene objects such as a spellcaster, a target, a projectile, or the camera. You can even attach effects to animated nodes of an object, such as a character's hand. Create complex tracking effects using constraint history.
End Qoute
The only obstacle you will have is tying your animation to the mouse curse. Which Determinance (another torque based game) did very well. As i am not a programmer i wouldnt have a clue how todo it, but it gives some leads of practicle examples. You might be better talking to a programmer or having them setting up your system, though you need to get some models done to do what you are asking. You dont need to worry about bullet speed (unless thats a specific point of your game) as the bullet trail will follow from your gun, which will be matched by your animation/targeting setup. If i understand you and what your asking.
06/19/2008 (6:31 pm)
www.garagegames.com/products/102/The AFX system has a mouse/cursor targeting system.
Quote
Powerful Constraint System
Independently constrain the position and orientation of any effect to other scene objects such as a spellcaster, a target, a projectile, or the camera. You can even attach effects to animated nodes of an object, such as a character's hand. Create complex tracking effects using constraint history.
End Qoute
The only obstacle you will have is tying your animation to the mouse curse. Which Determinance (another torque based game) did very well. As i am not a programmer i wouldnt have a clue how todo it, but it gives some leads of practicle examples. You might be better talking to a programmer or having them setting up your system, though you need to get some models done to do what you are asking. You dont need to worry about bullet speed (unless thats a specific point of your game) as the bullet trail will follow from your gun, which will be matched by your animation/targeting setup. If i understand you and what your asking.
Torque 3D Owner Edward