Moving player in direction they're looking

Started by Blaziken77mw on

Topic category: Help with MCreator software

Last seen on 22:11, 19. Dec 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Moving player in direction they're looking

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:
  • 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:
  • 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.

Last seen on 12:46, 3. Feb 2024
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
what category is the [set…
Mon, 01/02/2023 - 17:16


what category is the [set local yaw to] block in?

Last seen on 00:42, 10. Oct 2023
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
local yaw is a number…
Mon, 01/02/2023 - 20:15

local yaw is a number variable

Last seen on 16:51, 17. Apr 2024
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This still helps me to this…
Thu, 03/16/2023 - 03:46

This still helps me to this day

Last seen on 01:06, 14. Mar 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not sure how to do it…
Thu, 03/16/2023 - 04:17

I'm not sure how to do it with procedural blocks, but the code goes something like
player.setDeltaMovement(player.getDeltaMovement().add(player.getForward()));

Last seen on 13:17, 8. Jan 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Kuri_Pa paste the screenshot…
Wed, 11/29/2023 - 13:13

Kuri_Pa paste the screenshot I need this

Last seen on 13:17, 8. Jan 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
guy I dont know Imy plugin…
Wed, 11/29/2023 - 15:05

guy I dont know Imy plugin changed but I think I solve it if anyone need this is the solution (I install player animation plugin and gecko lib and I use 1.20.1 version)

 

https://imgur.com/gallery/uCDmfSg