Grabbing system ideas!

We can grab things following this conditions: if some object is from “moveable” list (maybe just make inheritance from moveable class directly) , object is inside player grabbing ray distance, certain key is pressed.
The player should have a component like “CanGrabLoot!” which provides him this mechanism. It should work like this: if (IsKeyPressed(Keyboard::E)), then we should search for objects inside grabbing ray distance, calculate which of them we want to grab (based on player view camera i.e direct look at the object), check if the object is moveable, and if it is, bind his coordinates with player coordinates - loop (Until certain key is not pressed again) the chair coordinates to follow player coordinates (+ grabbing ray distance and Z-axis distance for “fly” effect, maybe some rotation). If this certain key is pressed again, then chair should stop following the player and drop on the floor via gravity.

Privacy & Terms