- Home /
Question by
J-R-Wood · Sep 03, 2018 at 03:53 PM ·
physicsraycastperformance
Physics.Raycast (Cheapest Methods)
I am doing this because in my mind it was cheaper on my fps to do than call a raycast every frame but i wasn't sure if this was a good alternative or if there is an even better option.
TimedCheck-=Time.deltaTime;
if(TimedCheck<1)
{
TimedCheck+=25;
var hit3: RaycastHit;
if(Physics.Raycast (cameraz.position, cameraz.forward, hit3, 20))
{
Nearest=hit3.transform.position;
}else{
Nearest=Cam.position;
}
}
Comment