Ballista Mechanics

So I made a ballista which is supposed to have a quick reloading sequence.

The problem is that I’m trying to make the arms on the side bend while the arrow is being pushed back.
image
image

I’ve tried using CFrame.angles and a pivot part welded to the arms but since that pivot has to be welded to the rest of the ballista, whenever it moves, the whole ballista moves with it. I tried like 12 solutions online and none of them fit my case. It wouldn’t be so hard if the ballista wasn’t a movable object.
Solution 1 would be to find some sort of constraints to attach a part to another without being welded to it.

Have you tried a hinge constraint?

Yes, but they go all over the place and even the Servo wasn’t precise. I mean it could be done if I take a lot of time with a hinge but I just wanted to know if there is anything to do to fully control its position trough scripts.

Can you provide a video? Im not sure exactly what you mean

I mean that im very bad with all constraints and the physics engine so i would rather have everything handled by scripts. My goal is to simply pivot a part around an axis as shown in the 2 images (before & after) without it being laggy for the server since there is going to be plenty of other ballista.

You Can Probably use markers and TweenService

Lets assume you have them

TweenService = game:GetService("TweenService")

TweenService:Create("Item", Tweeninfo.new(0.2,Enum.EasingStyle.Elastic, Enum.EasingDirection.InOut,0,true), {Position = "YourMarker".Position}):Play()

Your Marker is just your Part or Attachment’s Position to wear your arrow holder will go.

In Studio, there’s a Castle template. Open that one and inside the castle wall there’s a blacksmith shop. The forge has bellows that you can jump on. That’s a hinge constraint. Look at it, copy it. There’s a script associated with it too. I made it so about 25% of the time, the forge will explode.

1 Like

You made the castle template? If so, thanks because thats the one im using to make a prototype of my game :smiley: . And thanks for the info, im looking into it as we speak.

Yeah that was my other option but it behaved weird with the springs. Thanks for the idea tho, ill be looking more into how to properly do hinges.

No, I did not make the castle prototype. I know about it because I’m using it in my test game. I think that hinge is what you want.

Ohhh this is what you meant by I made it. Got you

Don’t use springs, use force, like the bellows.

Poor choice of words on my part. I modified the script so about 25% of the time it will explode with some force. It blows the forge apart and sends parts flying. And it moans when you jump on it. If you want to check it out, The Proving Grounds.

I just pushed a new update to the live server, so give it a few minutes. I’m working on anti-cheat code so there’s probably some bugs. If you get kicked for something, don’t worry about it.