#raycasthit.triangleIndex returning ''-1''

1 messages · Page 1 of 1 (latest)

bright iris
#

hey guys.
im made this system that gets the active texture on a triangle mesh for bullet impact effects but ive gut a problem.
i just made it compatible with LODs and im getting this error on this object saying that the triangle index provided by the raycast hit is -1

-1 means its invalid, meaning it either didn't hit a triangle or hit something that isn't a mesh collider
which is not true?
my gameobject has a mesh collider
the raycast DOES in fact hit the gameobject
read/write is also enabled on the model

code : http://pastie.org/p/4WKNzJuF5LhWJpcd71LE6l

meager patrol
bright iris
#

do you mean mesh collider and renderer?

#

in that case thats not exactly true. as i said other objects work fine because i can get the mesh renderer and filter through the lod group

meager patrol
#

ah sorry missed that

#

can you log what type of collider you hit?

#

is the meshcollider Convex?