Page 1 of 1
A Turret on a turret
Posted: 28 Aug 2009, 10:56
by Erik
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.
Re: A Turret on a turret
Posted: 28 Aug 2009, 12:26
by Master-Athmos
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
Posted: 28 Aug 2009, 15:13
by rattle
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
Re: A Turret on a turret
Posted: 28 Aug 2009, 18:42
by Evil4Zerggin
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.
Re: A Turret on a turret
Posted: 28 Aug 2009, 18:47
by FLOZi
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.
They did have working ones at some point with some fancy zwzsg code... dunno when it all got broken.
Re: A Turret on a turret
Posted: 29 Aug 2009, 07:14
by Forboding Angel
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
Re: A Turret on a turret
Posted: 29 Aug 2009, 07:19
by Evil4Zerggin
Yeah, that's a simpler way to do it, provided the sub-turret is centered on the main turret.
Re: A Turret on a turret
Posted: 29 Aug 2009, 12:07
by Forboding Angel
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.
Re: A Turret on a turret
Posted: 29 Aug 2009, 13:04
by Master-Athmos
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...
Re: A Turret on a turret
Posted: 30 Aug 2009, 07:38
by rattle
Forboding 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.
...unless you don't want it centered which is likely for a machine gun on top of a tank's turret
Re: A Turret on a turret
Posted: 30 Aug 2009, 13:18
by Forboding Angel
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.
Re: A Turret on a turret
Posted: 30 Aug 2009, 13:24
by Erik
Well then i could just make the MG coaxial and unable to turn at all hm?
Re: A Turret on a turret
Posted: 30 Aug 2009, 19:56
by KDR_11k
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.