- Home /
(Android) Pick up objects with the cross from the centerof the screen
This time i will be more specific. :D I need a script for Android to pick up objects with a tag when i (onMouseDown) a GUI Texture. But i want to pick up the object what is in the front of my Cross from the center of the screen(see in screenshot)
I use the Joystick script and the FirstPersonControl script from Standard Assets(Mobile). I want to can look at a object with the cross, and when i press a button, to pick it up.When i press another button to leave it to fall.The objects have the tag: "pick" and it have colliders and RigidBody Components.Please Help.
Answer by Eno-Khaon · Sep 30, 2014 at 05:15 PM
If it's simply a cross from the middle of the screen, is there any reason you can't fire a short-range raycast from the center of the screen (Screen.width 0.5 and Screen.height 0.5) and see if it hits something nearby enough to pick it up?
Then, since they have rigidbodies, you could simply get a distance to the object on the initial grab, then apply physics force to push it towards a point that distance in front of you.
Your answer
Follow this Question
Related Questions
Unity Android - Rotation camera with Joystick on FPS Controller 0 Answers
Android Cardboard - Fake UI Overlay 0 Answers
Android Unity ARCore camera access 0 Answers
OnRenderImage in one of the two cameras, Android showing only post processed camera. 1 Answer
Second Camera Tearing on Android 1 Answer