Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do I create linked rigid bodies?


I originally wrote my own 3D engine in OpenGL + Bullet Physics (and a bunch of other libraries) in order to make a virtual creature evolution simulation. I now want to try to do the same in Unreal Engine 4. Unfortunately, I have no clue where to start or how to do anything, since examples either do not exist or use blueprints (I want to use C++). Could any of you give me some code snippets for creating some rigid bodies and linking them together with motorized joints, or at least point me in the right direction?

Thank you for any help you can offer.

Product Version: Not Selected
more ▼

asked Apr 18 '14 at 04:48 AM in C++ Programming

avatar image

1 1 2 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first


I have a video on this topic here

in my case the joints were not meant to allow any mobility, but I could have just as easily done that



The key word for your entire goal is this:


Look up some info here on this answer hub with that keyword

I've posted elsewhere on this topic

EDIT nvm its hard to find stuff that way

here's how you create the component:

 UPhysicsConstraintComponent* ConstraintComp = NewObject<UPhysicsConstraintComponent>(RootSMA);
 if(!VISVALID(ConstraintComp)) return;

Here's how you activate the constraint:

 //~~~ Init Constraint ~~~
 ConstraintComp->SetConstrainedComponents(RootSMA->StaticMeshComponent, NAME_None, TargetSMA->StaticMeshComponent,NAME_None);

Assuming you are linking two static mesh actors.

All properties are set via

 ConstraintComp->ConstraintInstance = //your own FConstraintInstance

check out the source code for "ConstraintInstance.h"

it has all that you want.

Limit motion, limit angles!

Limit Twists!

or Lock things all together!




more ▼

answered Apr 19 '14 at 03:22 AM

avatar image

10.6k 446 346 1088

avatar image CireNeikual Apr 19 '14 at 04:40 AM

Thanks for the response! The information you gave me on the constraints will certainly be useful, but I first need to figure out how to make rigid bodies before I link them together. How would I go about making a simple box-shaped rigid body? Sorry for such a noob question!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question