AlignOrientation On Tweened Part Doesn’t Work Properly

Im currently making my first ever game in roblox that requires a gear that ticks and able to stick players to it.
Also very new to AlignOrientation and AlignPosition and to constraints overall.

  1. What do you want to achieve?

I want to make a gear using tweenservice and alignorientation that can move a player.

  1. What is the issue?

The gear was able to bring players for a while but then stopped working after a while (the gear tweens but the player isnt moving with the gear).



Images about the gear and the tween script.

Notice how the center part of the gear moves after the attachmentholder (due to alignorientation) and suddenly became rigid after it breaks. Any help would be appreciated, thanks!

  1. What solutions have you tried so far?
  • turning off rigidityenabled makes the gear capable off moving the player infinitely like I wanted, but the gear will go all over the place and cant be contained.
  • somehow making the gear more larger / smaller affects how long the gear would work before it breaks.

Working with physics is always a bit of headache, anyway, try changing the gear density by going in to its Properties → CustomPhysicsProperties → Density, put the maximum you can(its around 9999 i think), and on AlighOrientation Constraint put the smallest value you can in responsiveness(if it doesn’t show then disable RigidityEnabled), by doing that the chance of it breaking is pretty much none, but can make it not follow the tweened part as intended, so you have to play around with responsiveness to get a good result, i personally would recommend put a value between 1 and 10, but you can put values until 256 if i remember correctly.

1 Like

Agreed, I think messing with the physics in roblox would be my second most hardest thing to do other than AI!

So I tried to make the density of the gear and the centre of the gear to 9999 and disabled RigidityEnabled, also cranked the responsiveness to 200 and 1 on two tests. Unfortunately the gear isnt moving maybe because its too heavy. Is there anything else I could do?

here are more photos on the gear that could probably help identifying the problem!




Well, did you test the gear without it being inside a wall?

1 Like

Actually, you forgot to change its maxtorque force, set it up to infinity(just hold 9 on your keyboard for 4 seconds or until it becames infinity)

1 Like

Here’s a (not) simple fix - It looks like you are making an obby, and the gear is supposed to spin around.

  • 1: Make the gear dense.
  • 2: Connect the attachments with a hinge constraint instead of AlignOrientation, give the hinge infinite torque, set the actuator type to servo, and you can set the orientation with the TargetAngle property.
  • 3: Add NoCollision constraints to prevent the gear from colliding with the wall, or use the better option, collision groups!
  • 4 (optional but highly recommended): Add a local script that duplicates the gears and deletes the original copies, forcing the client to calculate the physics of the gears at all times and eliminating the need for the gears’ rotation to be replicated over the network in order for it to move on the client. This prevents things such as exploiters using physics to delete the gears, and the gears jittering/lagging around when many players are near them. If the client lags from unnecessary physics calculations, add a function that anchors the gear when the player is far from it.
2 Likes

It doesnt collide to the wall, managed it with a collisiongroup!

Did that too, it still didnt spin unfortunately. Is there anything else I did wrong?

Yup! It is supposed to spin, I have one using hinge constraint as an alternative if this one doesnt work. Appreciate the tip on number 4 too!

But the one I prefer is the gear moving in a ticking-like move which is why I used tween and alignorientation. As far as I know I cant mimic the easing type on hinge constraints like tweenservices (well, probably not in a simple way)

Here’s a youtube video that has one like mine! They probably used BodyGyro and BodyPosition (which is now deprecated) as this is posted 2 years ago:

ROBLOX Adventure Forward 3: Crown of Shadows BLIND FULL DEMO 100% - YouTube (31:06)

If you tweak some settings on the hinge, like responsiveness, you can somewhat replicate the easing behavior. Also, if the actuator type is servo, you can increase the target angle every second to make it tick. Servo doesn’t spin the hinge constantly, it just rotates toward a target angle and attempts to keep it there.

2 Likes

Yo, this actually works. I never knew about the servo in the hinge constraint lol. It almost mimics the tween one perfectly!
Still though, this would be my alternative (might use it though) as I probably prefer the tween one because I would also need it for the moving platforms too which I’ll show from the same video:

ROBLOX Adventure Forward 3: Crown of Shadows BLIND FULL DEMO 100% - YouTube (31:23)

Unless is there any way to mimic the tween by using constraints instead? Really appreciate the help though, thanks!

PS: Im starting to think that all the “tweened” motion im seeing in the video there thats used for the platforms are all constraints. Could anybody confirm it?

Moving platforms? PrismaticConstraint! It works like a piston. If you want to have the platform move in more than one direction, add multiple prismatic constraints for each axis connected by invisible cancollide false parts.

You can also use BodyPosition and BodyGyro, both deprecated instances, if you don’t want to implement a complex system of constraints. However, the platform will be slightly lower than you want it to go.

You are probably right about all the movement in the video being constraints.

1 Like

Gotcha! Can’t try it right now as it is past midnight for me. I’m really a sucker for smooth animations lol.

I’m also aware about BodyPosition and BodyGyro, I just dont feel like risking it and use deprecated stuffs as they would have a higher chance to cause problems on later studio updates (probably). So I’ll probably use the constraints instead.

1 Like

Well, seems like I’ll mark your reply about hinges as a solution (because the tweens on the video are actually / probably constraints). I really appreciate the help, thanks a bunch!

I do have one last (?) question though. About the fourth tip you mentioned in your last reply, would it also be applicable for the moving parts? Or perhaps any constraints overall?

1 Like

Yes, you can do it for all moving parts. It makes the parts exist only on the client and not affected by network ownership.

2 Likes

Alright, thanks for being such a huge help man!

2 Likes

Man, tip number 4 its a really good idea, i am certainty going to use it, thanks for the info!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.