Collision on UE4 - How to?

Discuss issues pertaining to the various game/web runtimes of Creature here.
Post Reply
sinspaw
Posts: 17
Joined: Tue Jan 26, 2016 4:14 pm

Collision on UE4 - How to?

Post by sinspaw » Tue Jan 26, 2016 4:19 pm

Hello,

I've just recently acquired Creature. I'm loving the workflow and the production.

Here's my question:

I want to have a character wielding a sword, and I want only the sword to be used for specific types of collision, which probably means I need to use it as a separate actor.

How do I do this with Creature? Do I animate the character with sword and then export the character without the sword, and then export the sword separately and hope that they work well in unreal?

Or is there a better way to just tell unreal to treat the sword as a separate item using the same project under creature?

Thanks in advance.

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: Collision on UE4 - How to?

Post by chong » Tue Jan 26, 2016 4:54 pm

Hello,

You can do the following:

In the CreatureMeshComponent class:
https://github.com/kestrelm/Creature_UE ... omponent.h

There is the function:
FTransform GetBluePrintBoneXform(FString name_in, bool world_transform, float position_slide_factor);

This returns you the world transform ( make sure you check the world_transform flag ) of a particular bone you are interested in. You can then send the transform retrieved from this into your collider object of your choice. This allows you to craft any collider you want separately and then attach it onto one of your bones in Creature.

Cheers

sinspaw
Posts: 17
Joined: Tue Jan 26, 2016 4:14 pm

Re: Collision on UE4 - How to?

Post by sinspaw » Tue Jan 26, 2016 4:58 pm

Thanks so much for the quick response.

Two further questions:

a) Is there a way to call that function via blueprint? I'm not used to coding in C++ at all and I've been coding exclusively on blueprints.

b) Secondly, does the calling of the bones mean I have to export and import the assets as .fbx? Or will importing the creature project via the creature plug in will still give me access to the bones?

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: Collision on UE4 - How to?

Post by chong » Tue Jan 26, 2016 5:15 pm

Hello,

a) All those functions are already exposed in Blueprints, no C++ is required. In fact if you take a look at the Creature demos posted on github, they are all driven 100% by Blueprints using the Creature Plugin.

b) Those functions provided work with the Creature JSON export format. If you want to use the CreaturePlugin, you should export using Creature's native JSON format. However if you want to use the FBX pipeline ( which also works ), export to FBX and use UE4's default FBX functionality which should give you very similar features.

I encourage you to watch the Creature UE4 Tutorials posted on the Youtube channel to get setup.

Cheers

sinspaw
Posts: 17
Joined: Tue Jan 26, 2016 4:14 pm

Re: Collision on UE4 - How to?

Post by sinspaw » Tue Jan 26, 2016 5:17 pm

This is great news!

Thanks so much for your support. Great service.

Keep up the good work! :D

Post Reply