PITCHFROMMOMENTUM Doesn't seem to work

Mon Feb 14, 2022 4:56 am

Using g4.8pre-217-g2f56ff383-m

I believe I'm not doing something out of the ordinary as I searched and only found these modeldef properties as solutions, but I can't get models I'm using as rocket projectiles under any circumstance to change pitch. I've tried PITCHFROMMOMENTUM and USEACTORPITCH. Property PitchOffset has no effect, and changing pitch via ZScript also no effect or at least doesn't seem so.

The model: https://i.imgur.com/bCvAfeP.png

Here are the code snippets. It's a normal pistol that should spawn a missile, or my laser trail: https://www.toptal.com/developers/haste ... telaf.yaml

I would assume that by changing the pitch, double checking by printing it out, that the model should already be in the correct pitch. The path the laser trail travels is the correct pitch, but the model is not rotated. Firing at the floor or ceiling results in an unpitched model flying towards the target. Am I missing a step?

Re: PITCHFROMMOMENTUM Doesn't seem to work

Mon Feb 14, 2022 11:37 am

I think I see the problem, and it's the modeldef syntax. Try putting the PITCHFROMMOMENTUM flag on the beginning of the model definition, not on the end behind the frames. Because of the way how modeldef gets parsed, it goes line by line. Therefore, the flag is applied to nothing, because no definition follow after the flags.

Here is example, one of my many model projectiles.
Code:
model BlasterTracer {
   PITCHFROMMOMENTUM
   path "models/weapons/staff/"
   model 0 "BlasterTracer02.md3"
   skin 0 "tx_blasterTracer.png"
   scale 1.75 1.75 1.75
   offset 0.0 0.0 0.0
   frameindex DUMM A 0 0
   frameindex DUMM B 0 1
   frameindex DUMM C 0 2
   frameindex DUMM D 0 3
   frameindex DUMM E 0 4
   frameindex DUMM F 0 5
   frameindex DUMM G 0 6
   frameindex DUMM H 0 7
   frameindex DUMM I 0 8
}

Re: PITCHFROMMOMENTUM Doesn't seem to work

Fri Feb 18, 2022 6:58 am

Ah ha, that fixed it. Much appreciated.