Hi, I know this is stupid but I can't figure it out, how do I put these values to be negative ? to make the player to be launch in -z direction and not +z direction. PHP: if($block != 0 && in_array($block, $this->blocks)){ if(!isset($this->bounceVelocity[$player]) || $this->bounceVelocity[$player] == -0.0){ $this->bounceVelocity[$player] = ($player->getMotion()->getZ() + 0.2); } if($this->bounceVelocity[$player] <= $this->max){ $this->bounceVelocity[$player] = ($this->bounceVelocity[$player] + 0.2); } $this->fall->attach($player); $motion = new Vector3($player->motionX, $player->motionY, $player->motionZ); $motion->z = $this->bounceVelocity[$player]; $player->setMotion($motion); } if(isset($this->fall[$player])){ if(!$block == 0 && !in_array($block, $this->blocks)){ $this->fall->detach($player); $this->bounceVelocity[$player] = 0.0; $player->setMotion(new Vector3(0.0, 0.0, 0.0)); }
PHP: if($block != 0 && in_array($block, $this->blocks)){ if(!isset($this->bounceVelocity[$player]) || $this->bounceVelocity[$player] == -0.0){ $this->bounceVelocity[$player] = ($player->getMotion()->getZ() - 0.2); } if($this->bounceVelocity[$player] <= $this->max){ $this->bounceVelocity[$player] = ($this->bounceVelocity[$player] - 0.2); } $this->fall->attach($player); $motion = new Vector3($player->motionX, $player->motionY, $player->motionZ); $motion->z = $this->bounceVelocity[$player]; $player->setMotion($motion); } if(isset($this->fall[$player])){ if(!$block == 0 && !in_array($block, $this->blocks)){ $this->fall->detach($player); $this->bounceVelocity[$player] = 0.0; $player->setMotion(new Vector3(0.0, 0.0, 0.0)); } LOL, put this on facepalm