Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: greg on February 12, 2013, 09:39:23 AM

Title: Raycast alternatives
Post by: greg on February 12, 2013, 09:39:23 AM
I heard that raycasts can hit performance pretty hard. What are the alternatives? Does mousePick use a raycast, or is it something different? Basically looking for ways to lower the performance cost of raycasts.

I'm making an fps, if my player is looking at an object, and within a certain distance of it, it would be good to put "pick up gun", "open door"..etc, would this mean raycasting every frame and seeing what we hit?

Thanks
Title: Re: Raycast alternatives
Post by: Andrew.Lukasik on February 12, 2013, 04:42:01 PM
Hi,
 I don't know full answer to this but it might be worth keeping in mind that items can check isVisible, check distance and raycast toward player too.
 As general rules it's advised to raycast only on selected layers and preferably with simplest collision geometry.

A.