- Home /
Raycast ignore player Network
im having a problem for this FPS where i need to an instantiated bullet to ignore collision with the person who shoot the bullet; problem is, this is a LAN game so i dont think i can just ignore a layer or tag as normal. I attached a simple script on a bullet prefab:
var Hit : RaycastHit;
if (Physics.Raycast(transform.position, transform.forward, Hit, Range))
{
//do stuff
}
i a bit at a loss at wat to do and read on it but dont understand how the layer numbering system works, how do i go about fixing this problem as simply as possible?
Answer by Jonaskulhanek · Sep 08, 2013 at 11:49 AM
Try out this. Assign Layer from the inspector to those layers you want the raycast to interacting with.
var Layer: LayerMask;
var Hit : RaycastHit;
if (Physics.Raycast(transform.position, transform.forward, Hit, Layer))
{
//do stuff
}
Your answer
Follow this Question
Related Questions
Raycast doen not work on network client 0 Answers
Picking up few different objects 0 Answers
SphereCast Arguments 1 Answer
Having a RaycastHit event create a component? 1 Answer
Problem With RayCast 3 Answers