Immersive Vehicles (Formerly Transport Simulator)

Immersive Vehicles (Formerly Transport Simulator)

4M Downloads

[Suggestion] Need a way to change gun_yaw and gun_pitch values with collision boxes

PlumePack opened this issue ยท 5 comments

commented

Hey,
We're making an artillery gun, and we're trying to have it so clicking on specific parts of it change the gun orientation (like in real life). Would it be possible to make it so you can use several collision boxes to modify gun_yaw and gun_pitch, so that we can rotate the cannon and have it shoot where we want to aim it at? (As in: one collision box would increment gun_yaw by 1, another collision box would decrease it by 1, same with pitch...)

That way, it'd make it so the cannon stops shooting straight even when rotated (we're rotating with different variables right now...) and would let us set limits to how much the cannon can rotate

commented

If I'm not mistaken, variableModifiers could in theory do this right now? Give it a go, and make sure to try it both on the vehicle/mounting part side then on the gun itself.

commented

It doesn't seem possible atm, we tried doing that and it still breaks

commented

gun_yaw should be able to be changed by hitbox variables incrementing or decrementing that. If you can't, then I'd need to adjust the code to do such a thing. VMs shouldn't be required.

Is such a thing possible currently, or do I need to make code changes?

commented

I will have to change this in the code, then. Because it should be something that's possible to allow for placable guns you don't need to sit in to aim.

commented

Implemented in 22.4.0.