Help with Achieving Realistic Vehicle Control

Started by GoodGuyOlo on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with Achieving Realistic Vehicle Control
Sun, 10/27/2024 - 20:38 (edited)

Hi everyone!

Firstly I just want to say that I am no expert in minecraft modding and I just starded to play with MCreator about a week ago. So any help and tips would mean a world to me :)
 

I'm currently working on a mod (GeckoLib + Forge 1.20.1) that features various types of vehicles. Right now, I have a good vehicle model along with animations for driving forward, backward, and turning left and right. However, I’d like the driving mechanics to go beyond simply holding "W" or "S" for forward and backward movement while turning with the mouse.

What I’m aiming for is to have more realistic controls where the player can freely move the camera around the vehicle and use "WASD" keys for steering. Ideally, the wheels and vehicle would respond naturally to directional inputs.

Additionally, I’m looking for tips on how to implement realistic weight and gravity for the vehicle, so it can respond to the environment more dynamically instead of always staying perfectly level with the ground. Because currently, i am not able to go up the blocks unless i have strafe movement control enabled in my entity config.

Any advice or insights on how to achieve this would be greatly appreciated!

Edited by GoodGuyOlo on Sun, 10/27/2024 - 20:38
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To make it turn naturally…
Fri, 01/17/2025 - 23:07

To make it turn naturally When you press a or s you will make a producer that will make the vehicle turn 3degrees every tick

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create a keybind and then in…
Fri, 01/17/2025 - 23:17

Create a keybind and then in the when pressed have it turn 3 degrees. You would have to spam the button unless you had it trigger a global variable in a procedure called each tick and then had it change back to false if you press it again.

Joined Nov 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is a On Key Pressed &…
Sat, 01/18/2025 - 00:16

There is a On Key Pressed & On Key Released Procedures you do know? Meaning you can just create a Variable called "APressed" or "DPressed" And when A is pressed for example; make the "APressed" Variable True and when released make it false. Then in any Tick update procedure you have for this, Just make a check to see if one or the other value is true, Then make it turn in the Direction (Using advice above) in relation to the key you pressed. Then ElseIf None of those are being pressed, Then move forward only. Hope this kinda helps,

Joined Nov 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh and forgot to mention you…
Sat, 01/18/2025 - 00:18

Oh and forgot to mention you do need Keybind elements for your buttons if you don't already, in the Keybind you will find onPressed or onReleased ^

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But how do you make a custom…
Thu, 01/30/2025 - 15:24

But how do you make a custom entity move forward relative to the custom entity looking at??

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Save the player's look angle…
Thu, 01/30/2025 - 22:14

Save the player's look angle as a global variable