Moving player in direction they're looking

Started by Blaziken77mw on Fri, 07/23/2021 - 04:21

Topic category: Help with MCreator software

Last seen on 16:23, 3. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Moving player in direction they're looking
Fri, 07/23/2021 - 04:21

I'm trying to make an item that moves the player in the direction they are looking when they hold right click, but I haven't been able to find a way to get the direction they're looking into the motion vector

Last seen on 16:31, 21. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I have a code that makes the…
Fri, 07/23/2021 - 11:01

I have a code that makes the player gain momentum towards the direction they are looking.

maybe it will help you.

You only have to copy the code that is marked in red, you leave it, it does not work for you.
code

Last seen on 16:31, 21. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Explanation: You can't get a…
Fri, 07/23/2021 - 11:04

Explanation: You can't get a vector, since there are no procedural blocks that do it (with code maybe), but you can get the Angle at which Steve's head turns (Yaw), only with a simple transformation you can get the unit vector of X and Z shown in the image.