Idea for a grabbing system

(I feel like this could be easily done using inheritence, but I don’t know enough about the existing classes so it feels easier to do it this way).
Use a component attached to the object which is grabbable.

Use the position of the object and the position of the pawn to to work out a distance and decide if the object is close enough to be grabbed.

While it is within grabbing range (assumedly a short range) (also in the center of the player’s screen?) then move the object to a value relative to the pawn to allow movement controlled by the player (some way to make it stay in front of the player?).

Have the distance that the object is held from the pawn be very close (equal?) to the grabbing range, so that if the player is moving towards the object the grabbing will continue to happen, but if the player moves away from the object by the time a game tick has passed the player will be far enough away to stop grabbing the object

This plan is made based on using only what we know already, I assume there are many functions and interactions that would be extremely useful and make this easy but I don’t know them yet.

Privacy & Terms