Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Attatching Rigid Bodies to Enemies
Author Message
SleeperCell Offline
DrPoo returns

Posts: 14
Joined: Jan 2017
Post: #1
Attatching Rigid Bodies to Enemies

I want to be able to attach rigid bodies to an entity while they move. I want to be able to pick up an enemy and throw him like an object while still retaining the AI.

Is that even possible? Any help is appreciated. Tongue
(This post was last modified: 01-29-2017 04:13 PM by SleeperCell.)
01-28-2017 11:16 PM
Find all posts by this user Quote this message in a reply
CarnivorousJelly Offline
Posting Freak

Posts: 1,195
Joined: Dec 2012
Reputation: 80
Post: #2
RE: Attatching Rigid Bodies to Enemies

It's probably possible if you wanted to modify the game's base code and object types. I don't think AI and interactable (read: you can pick them up) objects overlap at all.

Attaching rigid bodies shouldn't be impossible though if you open the model editor. I could be wrong though ¯\_(ツ)_/¯ never tried experimenting with this stuff before.

[Image: quote_by_rueppells_fox-d9ciupp.png]
01-29-2017 05:31 PM
Find all posts by this user Quote this message in a reply
SleeperCell Offline
DrPoo returns

Posts: 14
Joined: Jan 2017
Post: #3
RE: Attatching Rigid Bodies to Enemies

I tried merging the coral puppet's AI with the AI script of prop_rigid but it didn't do anything. I tried adding bodies to the character both in the model and level editor but they either push the enemy out of the map and destroying their in-built physics or float independently from the puppet.

This is super frustrating to get working. Angry
01-29-2017 09:12 PM
Find all posts by this user Quote this message in a reply
Abion47 Offline
Senior Member

Posts: 311
Joined: Oct 2015
Reputation: 40
Post: #4
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.)
01-31-2017 10:01 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)