- Home /
Question about raycasts and OnMouse functions
Hi all.
I have a question about raycasting and OnMouse functions, as the title says. I was wondering the the two could battle, resulting in the raycast not being picked up. I ask because in one of my scripts I have an OnMouseUp function that changes the camera and plays a movie when the object is clicked. However, in my main script, I am checking for raycasts to determine what objects have been clicked to add them to a list.
In one scene the camera changes and the video plays and the object is added to the list. However in another scene, all the exact same items, scripts, setup, everything, the camera changes and the video plays, but the item is not added to the list. I can't figure out what could be causing this, so my best guess is the OnMouseUp function is being done before the raycast hit. Am I on the right path, or can you all think of something else that would cause this kind of issue?
Your answer
Follow this Question
Related Questions
OnMouseButtonDown raycast 2 Answers
Raycast examples needed - alternative to OnMouseDown, OnMouseUp 1 Answer
Calling method once 2 Answers
OnMouseButtonDown Raycast multiple Objects 0 Answers
OnMouseDown for Right Mouse 2 Answers