3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Tank simulator - Please Help  (Read 2491 times)

« on: December 03, 2009, 01:24:44 AM »
Hi guys, I'm new to 3drad and I need some help. I'm trying to make a tank simulator just for fun and learning, but I can't seem to make it work. I looked at some tutorials on racing cars but nothing closer than that to a tank. This is where I'm stuck.

I designed a tank in Sketchup7 and esported the skinmesh of the bottom portion of the tank and the turret separately because I want the turret to rotate independently from the body of the tank. I added a car object and then attached both of the skinmeshes to that car object and they all move together. I also attached a chase cam. The problem comes when I want the turret to move independently from the bottom of the tank. I don't know how to do it. Also am I righ in attaching two meshes to the car object if I plan for the camera to look where the turret is looking and I plan to make projectiles come out of the turret like a FPS game. For the controls I want the turret to have controls for up-down-left-right and the bottom of the tank to move like a tank (rotate left and right , move forward and backwards)
« Reply #1 on: December 03, 2009, 07:51:55 PM »
Add the tank body to the car object as you have done, then add a joint object to the top of the car, then add a rigidbody to the joint, the add the turret skinmesh to the rigidbody.
« Reply #2 on: December 04, 2009, 02:15:51 AM »
Hey thanks, I'm getting closer to my goal. I attached the joint to the car object and then a rigid body to the joint and the turret skinmesh to the rigid body. I set the angles of the axis of the joint to only go up 15 degrees and to turn left and right -180 and 180 degrees. The problem now is how to make the turret stay in place until i press a key to move the turret up, down, left , or right. I would like to know how to do that and also how to set the turret to follow the mouse pointer with some cross on the screen to point where it will shoot.

Can anyone help me with the srcipt on that? I would really appreciate any help possible...
« Reply #3 on: December 04, 2009, 07:19:05 AM »
I am having similar problem for which I have partial solution.
See my earlier post http://www.3drad.com/forum/index.php?topic=2949.0
There is a complete turret solution together with gun and sight with rigibodies and joints, but, with the script I made turret and canon is moving somehow erratic.
Maybee someone else got a better idea...

And maybe turret object as a premade objects...
« Reply #4 on: December 04, 2009, 12:57:05 PM »
thanks galaxie500,

I'll be experimenting with your project. I looked everywhere for a previous and similar post and couldn't find one. Thanks for finding mine. I'll keep you posted on any new developments on the script.
« Reply #5 on: December 04, 2009, 02:43:37 PM »
Hi,

here, i'm throwing in another one try I've been playing around few weeks back. My idea was to use two joints for turret and two for gun. One joint is used as a break when no rotating is needed. You simply start them (unlock) before you apply the force to rigidbody and stop them when force is released. Sounds good in principle but make it work was little over me. And the other thing that didn't suit my need is that I can only do that by using keyboard controls while I need mouse to control the turret and gun.
Anyway, maybe this will give you another angle to a problem.
Looking forward to see your progress.

Here is a project.
« Reply #6 on: December 09, 2009, 11:49:29 PM »
Ok, so I've been working on the code you created and I haven't had much luck. I still can't figure out how to make the turret stay still until the mouse is moved or a key is pressed. I'm still working on it, but if anyone has any ideas or knows how to solve the problem please reply to the post. Thanks...
« Reply #7 on: December 13, 2009, 06:03:30 PM »
Hi guys. I worked on my tank simulator for a few hours and got to make a movavle turret and gun with forces being applied on input, but I came across a problem. When you press the key assigned to the force the force executes and moves the turret but it keeps on spinning until the force finishes. "It doesn't help for aiming." I need to make it more precise. The turret rotation and gun elevation has to be very precise for the aiming of the gun. Does anyone know how to solve this problem. "I was thinking maybe apply some type of counter force to stop the turret rotation at the moment I release the key or something. Well, here is an attachement of the file. If anyone can check it out thanks.
« Reply #8 on: December 13, 2009, 07:27:02 PM »
i havent tried this idea yet, but use a joint to link a sphere to the place where the turret is, and have the turret skinmesh linked to nothing

now add character object and link the sphere and skinmesh to it, set sphere as sphere model, and skinmesh as skinmesh.

adjust all movement speeds to 0 and the pitch(up and down) mouse movement to 0

now you should be able to rotate the turret with your mouse, and also the projectile object will stick with the skinmesh

Currently using 7.22
Pages: [1]