New answers tagged


Following @DMGregory's excellent feedback, I wrote the following class to test: public class MaterialTextureTest : MonoBehaviour { public Material material = null; public List<string> textureNames = new List<string>(); public List<Texture2D> textures = new List<Texture2D>(); // Start is called before the first frame ...


This code is meaningless: Vector3 incomingVec = hit.point - rayStart; Vector3 reflectVec = Vector3.Reflect(incomingVec, hit.normal); cursorSprite.transform.eulerAngles = reflectVec; There is no particular relationship between the orientation you want, and the reflection of the incident ray by the hit normal. There is no relationship at all between a ...


In this case, adjust rayLength will be a solution. if rayLength is too short, it will raycast inside of wall at next frame.

Top 50 recent answers are included