OK, so earlier I posted a question about trigger colliders which were recommended to me for my game. Basically, i want to be able to move a background object using the position of a game object in the foreground. Previously I had a cube in the foreground with a long box trigger attached to it to interact with objects in the background, the idea being that when objects activated its triggerStay, I could then trigger code to allow that object to me moved as a child of the foreground object.
However, I've had some issues with this (such as objects not being found despite having a rigidbody and collider) and was wondering whether it might be possible to do it with a raycast instead. Here's what I want to know.
P.S. I know a mouse is a better way to do what I'm describing, but this is for a degree project game that relies on a physical method of control so that's not an option for me right now.
Thanks, if I've made this a bit confusing please tell me and I'll try to elaborate it a bit clearer. I am a newbie when it comes to Unity, so these might be half understood ideas that dont make sense to you experienced users
asked Feb 28 '11 at 09:54 PM
you can get the screen point of an object using WorldToScreenPoint
and raycasts can go from any 2 points that you'd like, or make a ray from the screenpoint of that object position with a certain length. A ray as such should go directly away from the screen, rather than being distorted by perspective.
EDIT: If you wanted perspective to be gone as a whole you could use a camera with orthographic projection