Physical constraint with child actors?

Hi all,
I have created a BP in which there is a disc which is set to free wheeling using a physics constraint. I have set twist motion to be free so that whenever my player hits it it rotates freely. I have set ‘Simulate Physics’ on as well.

Now I am trying to put this BP as a child actor on another BP with a larger disc. For this larger disc, I have set it to rotate in a to-and-fro manner between two angle values. I use simple timeline for this.
My problem is this: When I put the larger disc BP in my level, it starts rotating but without the smaller disc.

How do I set it up so that: the larger disc rotates, along with the smaller one - which in turn should already have the free-wheeling effect. I am trying to create a merry-go-round kind of a thing as shown in the pic. The platform with blue pipes rotate, and the chairs on top are free to spin.

340973-four-seater-marry-go-round-500x500.png

Anything? Anybody? Hint/Clues?

So, as an example:

  • Create a Blueprint of class Actor
  • Add a StaticMesh (Cube), call it Base (this part will not rotate)
  • Add another StaticMesh (Cylinder), call it Disc_Large
  • Add a PhysicsConstraint, call it Rotator_Large
  • Add a StaticMesh (Cylinder), call it Disc_Small
  • Add a PhysicsConstraint, call it Rotator_Small

like this:

341445-blueprint-setup-1.jpg

Now, click on Disc_Large and activate SimulatePhysics. Do the same for Disc_Small. Click on Rotator_Large,

  • DisableCollision,
  • ComponentName1=Base, (CONSTRAINT)
  • ComponentName2=Disc_Large, (CONSTRAINT)
  • Swing1Motion=Free,Swing2Motion=Locked, TwistMotion=Locked, (ANGULAR LIMITS)
  • Set AngularDriveMode to TwistAndSwing, set TargetVelocity Z=0,3, Strength=100 (ANGULAR MOTOR)

click on Rotator_Small

  • DisableCollision,
  • ComponentName1=Disc_Large, (CONSTRAINT)
  • ComponentName2=Disc_Small, (CONSTRAINT)
  • Swing1Motion=Free,Swing2Motion=Locked, TwistMotion=Locked, (ANGULAR LIMITS)
  • Set AngularDriveMode to TwistAndSwing, set TargetVelocity Z=-2, Strength=1 (ANGULAR MOTOR)

Position your objects somehow like this:

Place the Blueprint in your level, click the Dropdown on your PlayButton and select Simulate. Have Fun :slight_smile:

Hi @L1z4rD89,
Thanks! This certainly works. The way I am setting it up is to use Disc_Small in another (child) BP, where I have set the physical constraint you mentioned (Rotator_Small).
So in the example picture I shared, the ‘Chair’ is a child BP, which I have put inside ‘Frame’ BP as a child actor. I do this so that I can make the ‘Chair’ a generic BP and reuse it else where in my level. Also I am setting ‘Frame’ to rotate in a to-and-fro motion using Timeline, so what should happen is as in a real-world merry-go-round like this. The frame rotates and chairs are allowed to move freely on their own axis/pivot.

Hi @L1z4rD89, it works! Thanks buddy for the example files! You are very kind!
I was not including ‘NullObject’ in the BP. I think it works as a kind of pivot point for rotation, so instead of ‘NullObject’ now I have put a cylinder there! Thanks again!
Not sure how do I make your comment as an answer! It is only allowing me to mark my comment as an answer!! But feel free to do so! :slight_smile:

1 Like

I hope that I understood it all :smiley: But test this:

In this example you can add the BP_Chair as a Child. The important setting in the BP_Child is the Swing1Limit to let it look like it would rotate from the rotation of the base. The adjustment of the base movement (BP_Frame) is up to you.

Hey, great that it works. I changed my comment to an answer :slight_smile: And yes: NullObject is the pivot. You cann set its scale to 0 to hide it.