Hey NorthWest (and other forum members), saw your MCreator tutorials, and I was wondering with the 1.20.1 MCreator update, is there a way to do pitch up and pitch down for my plane mod using mouse controls (where the player looks)?
I tried using someone else's code on MCreator forums, but that didn't work. The plane still doesn't control for VY, and I don't know the math for that.
Here's the Forum procedure that I used.
Attempt to override motion vector of event/target entity to:
VX: 0-sin(direction/yaw in deg relative to source entity * PI / 180)
VY: .3
VZ: cos(direction/yaw in deg relative to source entity * PI / 180)
I don't get the math, but I tried using it anyway.
Sorry for the late reply I just noticed that the post was pending so I approved it. This should be possible in 1.20.1 using movement vector and a trigger of some kind to apply NBT variables to the player. You will need a update tick for the entity that will then use the look direction for the movement. No real math needed as the values for the look direction are between 0 and 1 so it should be a reasonable speed for flying.
You can of course devide or multiply the value to make it go faster or slow if needed too. The way I have it set up with my drones is though a key bind for W and S for forward and backward movement when a key is pressed the player gets a logic variable assigned which the entity looks for in it's tick update script.
Stearing can be done by looking left or right and ailerons I used A and D for down and up movement while looking streight. This seems to get it working realtivly quickly with vary minimal math. Of course this is more complex with the drones because I have lots of features but it should work with planes really well.