Open hsniemi opened 7 months ago
Initial sketch of classes
As discussed, here's a quick class diagram sketch to help to narrow down the scope of this task. The diagram is not definitive and more methods or fields can be added as deemed needed,
Most notably here all the OnSomething()
should be left unimplemented, so that the concrete instances of this base class may do that if they need to.
The other methods, such as Grab()
, Release()
, and Interact()
should however be implemented in the abstract class itself.
The main task here would be to figure out the best way to link the grabbable object to a parent Transform
provided in the Grab()
method.
The branch containing the code for this issue: https://github.com/GroupThesis2024/Paramedic-Training-Game/tree/ISSUE%2323-design-classes-for-interactables
I tried a different way of grabbing the object. Instead of setting the controller as the parent of the grabbable object in Grab() method, I set the parent Transform as the target toward which the object moves in FixedUpdate(). This eliminated the erradic behaviour (attaching far from the parent, flying away on grab, sometimes falling through other objects when detaching) of the object which was only manifesting when using a real vr device.
Grab() and FixedUpdate() methods in Interactable class
Designing classes with an abstract base class for creating interactable objects, such as a medical bag and equipment.