Hi All,
I have 2 game objects. One is a character model and the other is just an object about half the height of the character. I have game and scene views on my computer screen at the same time. When playing in such a layout, my raycasting works fine but whenever I maximise my screen, the raycasting is unable to detect the object in front of my character. Why is this so? Is there some issue with my origin parameters?
Exactly the same code I used for my testing as shown below. Theoretically-wise, what went wrong? Both have colliders and my character is able to knock against it. One weird thing I notice is when I maximise the “play” mode, the object seems to be 1/3 the height of my character instead of 1/2. Thanks.
if(Physics.Raycast(thePlayer.transform.position, thePlayer.transform.TransformDirection(Vector3.forward), out hit, 3)) Debug.Log(“ok”);
thanks ahaykal!
– Aaal