1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved AxisAlignedBB->isVectorInside() keep returning false

Discussion in 'Development' started by EndermannbugZJFC, Aug 16, 2020.

  1. EndermannbugZJFC

    EndermannbugZJFC Slime

    Messages:
    84
    GitHub:
    endermanbugzjfc
    For some reason my
    PHP:
    AxisAlignedBB->isVectorInside()
    keep returning false even if im inside the AxisAlignedBB area (At PlayerMoveEvent)

    Here is my code:
    PHP:
    var_dump('to'$e->getTo()->asVector3());

    var_dump('Start: 'LobbyWorldUtils::getParkourStart()->isVectorInside($e->getTo()));

    var_dump('End: 'LobbyWorldUtils::getParkourEnd()->isVectorInside($e->getTo()->asVector3()));
    Result:
    Code:
    object(pocketmine\math\Vector3)#100027 (3) {
    ["x"]=>
    float(390.5)
    ["y"]=>
    float(123)
    ["z"]=>
    float(263.5)
    string(7) "Start: "
    bool(false)
    string(5) "End: "
    bool(false)
    Anyone got a solution please?
     
  2. tungstenvm

    tungstenvm Witch

    Messages:
    54
    you must give us the
    PHP:
    LobbyWorldUtils::getParkourStart()
    and
    PHP:
    LobbyWorldUtils::getParkourEnd()
    returned values
     
  3. EndermannbugZJFC

    EndermannbugZJFC Slime

    Messages:
    84
    GitHub:
    endermanbugzjfc
    I solved it by using AxisAlignedBB->isVectorInXZ() instead of isVectorInside() oof
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.