A Turret on a turret
Moderator: Moderators
A Turret on a turret
So i got the big tank with an small machingun turret ontop of the main turret. How can i make it target and turn indivdually? I tried several things but the (visual) aim angle is always off by the degree of the main turret, while the shots go in the right direction.
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: A Turret on a turret
Don't make the MG a child object of the turret because if you do so the MG always will be connected to the turret's movement...
Re: A Turret on a turret
It's possible to reaim the top turret visually even when it is a child, however to make it easy put the top turret in the center of the bottom one so you don't have to worry about that
yo dawg i herd you like turrets, so i put a turret on yo turret so you can reaim while you aim
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: A Turret on a turret
What you need to do is put an empty piece between the main turret and the pintle. When aiming the main turret, turn the empty piece in the opposite direction. That way the base of the pintle will always point the same as the unit, not the main turret.
s44 has the same problem, just nobody's gotten around to fixing it.
s44 has the same problem, just nobody's gotten around to fixing it.
Re: A Turret on a turret
They did have working ones at some point with some fancy zwzsg code... dunno when it all got broken.Evil4Zerggin wrote:What you need to do is put an empty piece between the main turret and the pintle. When aiming the main turret, turn the empty piece in the opposite direction. That way the base of the pintle will always point the same as the unit, not the main turret.
s44 has the same problem, just nobody's gotten around to fixing it.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: A Turret on a turret
Guys it's easy
Just don't attach the turret on the top the the biece below it, attach it to the chassis.
Visually it will still look exactly the same and not need any crazy hacky code in cob.
Hierarchy:
Chassis
|-turretmain
|-turrettop
Just don't attach the turret on the top the the biece below it, attach it to the chassis.
Visually it will still look exactly the same and not need any crazy hacky code in cob.
Hierarchy:
Chassis
|-turretmain
|-turrettop
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: A Turret on a turret
Yeah, that's a simpler way to do it, provided the sub-turret is centered on the main turret.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: A Turret on a turret
No, the top turret isn't connected to the main turret, so then all you ahve to do is set the object origin centered on the top turret.
This really isn't difficult.
This really isn't difficult.
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: A Turret on a turret
Actually Evil4Zerggin has a point here - if your MG isn't centered above the main turret you need to have it attached as a child (like for THIS TANK)...
When the main turret turns the MG cannot stay in place but has to move with it as it simply is attached to the turret. You could solve this point by still having the MG as an independent child and setting its center to the identical place of the main turret and just do another turn call in the aiming script. This would totally break the MG's ability to aim though (as it'd just rotate around the main turret center and not around itself...
When the main turret turns the MG cannot stay in place but has to move with it as it simply is attached to the turret. You could solve this point by still having the MG as an independent child and setting its center to the identical place of the main turret and just do another turn call in the aiming script. This would totally break the MG's ability to aim though (as it'd just rotate around the main turret center and not around itself...
Re: A Turret on a turret
...unless you don't want it centered which is likely for a machine gun on top of a tank's turretForboding Angel wrote:No, the top turret isn't connected to the main turret, so then all you ahve to do is set the object origin centered on the top turret.
This really isn't difficult.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: A Turret on a turret
hmm
YOu could jsut give the top turret a much faster turn speed than the main turret. Use different signals, and you should get the desired effect. Or even easier, use the same signal for both (so they'll both aim at the same target religiously.
YOu could jsut give the top turret a much faster turn speed than the main turret. Use different signals, and you should get the desired effect. Or even easier, use the same signal for both (so they'll both aim at the same target religiously.
Re: A Turret on a turret
Well then i could just make the MG coaxial and unable to turn at all hm?
Re: A Turret on a turret
Seriously, why talk about workarounds when it has already been answered:
Evil4Zerggin wrote:What you need to do is put an empty piece between the main turret and the pintle. When aiming the main turret, turn the empty piece in the opposite direction. That way the base of the pintle will always point the same as the unit, not the main turret.