I am working on this rope swinging system to kind of learn the new physics constraints better, and I was trying to use the AlignOrientation constraint to make my player point its head towards the end of the rope, while also looking in the direction of their velocity. I am not very good at vector math, so my result looks like this:
Note that I was not pressing any keys during this, my character just kind of automatically swung itself, and it doesn’t at all do what I had intended. This is the code I used to set the CFrame of the AlignOrientation: (It was set to 1 attachment mode)
The CFrame of the AlignOrientation was set every heartbeat on the server.
I was hoping someone could help me figure out the correct equation to replicate the effect that I am looking for. Thanks!
Yes, you’re right, I should be doing this on the client, but this is mainly for convenience right now as I am just testing.
I enabled rigid mode on the AlignOrientation and not much really changed, if anything the swinging issue got worse. It is not really my main problem though, I am just trying to get help on what the right equation would be to make the AlignOrientation point my characters head to the rope end and face it towards the velocity.
I usually find it by trial and error. Try continuously setting the orientation to different 90-degree increments (like 90,0,0, 180,0,0, 0,90,0, 0,0,-90, etc.)