Consideration about how to implement the grabbing system:
- We can use either a raycast, probably casted from the default pawn camera, or we can detect a collision with a trigger volume.
- If we use the recast solution raycast we could look at collision presets and objects, see if something here is good for us or if we need to create something new. If we use trigger volume solution it will be enough to add a component to the every object we can grab.
- PROs & CONs: probably the trigger volume component will be easier to implement, but it will be more difficult to handle the object manipulation, instead with raycast it should be more challenging at first but easier and more flexible in future. Raycast could be overkill for this game.
Question answers
- I think a component will give us more performance and flexibility than inheritance
- You can find what to grab just by looking at the absence of the component
- I know what to grab by raycast and look at the object type. Let’s see where the course goes!
- I would work with a chair at the moment, then with a table, so it will be very useful to have a component or an object type that will let us understand what it is grabbable.