So I’m trying to write a serversided interactables system, and decided it might be better if i shaved off unneeded grouping and instances in the interactable itself.
Red one’s only rotating it off an anchored point connecting to a tweened Motor6D, while Green’s tweening the cframe of the entire anchored hinge to another invisible point in the model, moving everything welded to it with it.
Yet despite the fact the exact same parts are collidable, unanchored and moving, they don’t collide similarly at all and I’m pretty confused as to why.
If you are posting in code review it’s probably best if you post the code.
It almost looks like the original code for the red door template used to have a door that was Anchored and changed to CanCollide false so players could walk through it, but it was later added to so the door swung instead but still has the CanCollide false/true section of script.
Please Copy/Paste the red door code here with 3 backticks (```) before and after the code so it formats properly in the forum.
Why tween a Motor6D? You can set the MaxVelocity on it and just change the DesiredAngle of the joint, like using a HingeConstraint set to Servo.
Collision changes do not happen on these doors, both are calling the same exact module and all the module does is play whatever tween was sent from TweenModifiers; the difference in code is only in the info sent to the module
I’m not gonna lie to you though… I totally forgot maxvelocity was a thing that existed, but after seeing it just now i’m dead set on tweening instead. i wanted to tween it cause tweens let you apply Sine in/out and other easing styles, which makes the opening look way less linear without having to apply a server to client animation system (yet).
So is the red door the Anchored Part?
If so there’s a reason they recommend tweening an Anchored hinge Part with unanchored door Parts welded to it. The unanchored door is acting using Roblox physics.
If the anchored door is still moving (tweened CFrame) the tiniest bit then it’s not using physics to move, it’s stepping by CFrame the tiniest bit.
Both have an anchored hinge part with the unanchored door parts welded to it, i just don’t understand why the one using Motor6D instead of CFrame is so broken with collisions
An alternative is directly using Transform which works fine with collision but it doesn’t replicate. Since you seem to want to eventually use animations, it’d be a cleaner switch when you do if the original method tweened Transform itself on both the server and the clients.
As the linked post states, physics constraints work better for this, like a HingeConstraint. For a more weld-like solution you can tween the CFrame of an Attachment of a RigidConstraint.