RE: Attatching Rigid Bodies to Enemies
The attaching thing is quite possible, and is actually not too terribly difficult. IIRC, in the Level Editor, if you add an entity name to an entity's ParentAttachEntity field (under "Attachments"), the entity will then be attached to the parent, and will move around relative to its parent's position and rotation.
The picking up and throwing of enemies, however, will be quite a bit more complex. In order for something to be picked up and thrown, it needs to have a physics body. Monster entities already have a character body, however, and as you've already discovered in your experimentation, physics bodies and character bodies do not play well together. The only recourses to approach this problem would then have to be two-fold: design the physics body so that it is as close to the character body as possible without actually touching, or have two different versions for each entity (one with the character body and one with the physics body) and swap them around based on when they are being interacted with. The former option seems impractical, as it would require a ton of trial and error and the end result would likely be error prone, so I'd say the latter would be your best option.
As a starting point, I'd say that an optimal solution might be to check out Subnautica for an idea of how to implement this. In Subnautica, the player grabs the fish and holds them in his hand. In practice, I would guess that those two objects are actually completely different entities, and when the player grabs a fish, the game is actually destroying the fish in the world and creating a fresh version of the fish to display in the player's hand (which, incidentally, is exactly the same thing that happens in SOMA when you pick up a tool).
(This post was last modified: 01-31-2017, 10:04 AM by Abion47.)
|