Answer the question
In order to leave comments, you need to log in
What is the best way to track bullets hitting a player?
When I was making the shooting script, I ran into a problem - hitting the player, let's say, "does not always regatta".
I shoot not with a raycast beam because I need bullet physics.
I'm assuming it's because of the speed of the bullet itself (it is equal to the real one, 880 m/s), how can I better calculate the collision between the player and the bullet?
(At the moment I'm using OnCollisionEnter() )
Answer the question
In order to leave comments, you need to log in
because I need bullet physics.
$times = ['12:05', '14:05', '16:05', '18:05', '20:05'];
$now = new \DateTime();
$filteredTimes = array_filter($times, function ($time) use ($now) {
$diff = (new \DateTime($time))->diff($now);
// оставляем в массиве только время
// которое наступит только через пол часа минимум.
return $diff->invert && $diff->h * 60 + $diff->i > 30;
});
convert mktime to standard time and compare them, much clearer and more beautiful
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question