Giter Site home page Giter Site logo

Npc Rotation Issue about npc-lib HOT 15 CLOSED

plytki avatar plytki commented on August 11, 2024
Npc Rotation Issue

from npc-lib.

Comments (15)

derklaro avatar derklaro commented on August 11, 2024

Interesting, the method is used internally (in combination with the action controller) and works there perfectly fine from my testing 🤔

from npc-lib.

plytki avatar plytki commented on August 11, 2024

Maybe I'm doing it wrong. How can I properly rotate the npc and when should I?

from npc-lib.

plytki avatar plytki commented on August 11, 2024

image
I've tried everything.

from npc-lib.

ytnoos avatar ytnoos commented on August 11, 2024

I have the same issue

from npc-lib.

plytki avatar plytki commented on August 11, 2024

image
Line 128 is setting the position but still nothing.

from npc-lib.

derklaro avatar derklaro commented on August 11, 2024

The lookAt method returns a prepared packet, you need to send it to the target player(s), using .schedule

from npc-lib.

plytki avatar plytki commented on August 11, 2024

This also does not work. "/
https://streamable.com/273clz

from npc-lib.

derklaro avatar derklaro commented on August 11, 2024

Can you print out the result of bossNPC.getPosition() and walk to that position? That should be where the npc looks to...

from npc-lib.

plytki avatar plytki commented on August 11, 2024

https://streamable.com/jnspvf

from npc-lib.

derklaro avatar derklaro commented on August 11, 2024

Based on the printed values, it looks correct? (maybe I'm just misunderstanding the values tho 😂 )

from npc-lib.

plytki avatar plytki commented on August 11, 2024

Npcs are facing yaw 0. Not 90 as expected.
image

from npc-lib.

derklaro avatar derklaro commented on August 11, 2024

The yaw and pitch you're providing to the method are not taken into account. The method calculates the yaw and pitch to look at based on the position to look at (x, y, z).

from npc-lib.

plytki avatar plytki commented on August 11, 2024

Is there a way to change just rotation? I want to just change the rotation of the npc.

from npc-lib.

derklaro avatar derklaro commented on August 11, 2024

Might be a good helper method to add, until then you can use platform.packetFactory().createRotationPacket(yaw, pitch).schedule(...)

from npc-lib.

plytki avatar plytki commented on August 11, 2024

Ok, that works! Thanks!

from npc-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.