- Home /
How to pick up an object and inspect that object by rotating it!(HELP NEEDED)
Hello there, I am working on a game and one of the main features will be the inspection of items.
The player will be able to pick up an object by clicking on it and then be able to rotate it around.. kinda like the way you inspect stuff in L.A. Noir.
how can i do that.. i tried a lot of stuff.. with raycast.. some other stuff i managed to made it rotate but every item just rotates when i move the mouse.. or withe raycast i just managed to destroy every one i pick up.. please give me points..
is there a script already out there i could use.. something i could watch to see how i can do it ?
Unity Answers addresses single specific technical questions to help you write your own code. What you have is a general question with multiple technical issues. And you need to be clearer about the behaviors.
Does a picked up object instantly appear in front of the user, or drift up to them?
Can you drop an object, and if so, does it go back to where it was picked up, or drop to the ground?
What input by the user causes something to spin?
Does the object need to interact with the environment (i.e. physics) while being held?
Is the object to be added to an inventory?
Etc.
Break your problem down into pieces and solve each one of them. Start by researching the 'pickup' part of your problem. Some areas you might look into:
Physics.Raycast()
Vector3.Lerp()
Vector3.$$anonymous$$oveTowards()
Transform.parent (and parenting in general)
$$anonymous$$gestion: Create an empty game object and make it a child of your camera at the position you want to have items for inspection. This can be your target when you want to move something to be seen.
Your answer
Follow this Question
Related Questions
Collestion of objects 3 Answers
Pick up objects to destroy one object. 1 Answer
SAVE OBJECTS IN ARRAY 1 Answer
How to pick up an object using left mouse button 2 Answers
Change materials of connecting objects 0 Answers