Hello,
I’m trying to think of a way to create a Script that finds the current gameobject with a certain tag that I’m interacting with. Then selecting that object and placing it in the transform. Then when another object with the same tag is interacted with, take it and replace the current gameobject in that transform.
Any Idea what would be the best way would be for going about this?
the best way to do this is with collisions. as an example, cast a ray into the scene. if it collides with something, check its tag. if it is the appropriate tag, and you aren’t holding something already, then you can place it in the transform you want. when you walk up to another object, and press the button once more, you cast another ray into the scene. if it hits an appropriate object once again, check to see if we are already holding something. In this case we already know we are, so we can swap them inside our component. make sense?
Thanks for the reply @TimmyTheTerrible .
It was a lot easier then I expected. Basically just took 2 lines of code to solve. Thanks