You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
I am making portal-like game and obviously your velocity should save through portals
And I want my character fly like this brick( AssemblyLinearVelocity applied |0, 100, -100| )
What is the issue?
Issue is player just stops mid-air! (Same AssemblyLinearVelocity applied as for brick)
Note: it’s not weight, if I enable Humanoid.Sit then it flies perfectly how needed.
On this image Red line is rough trajectory that should player follow; Yellow - rough actual trajectory that player follows
What solutions have you tried so far?
I tried to find solution on DevHub, but the only option I found is enabling Humanoid.Sit, but obviously this doesn’t work for my game.
I am not expecting someone to write 500 line script for me. I want to get ideas for the solution, my current idea is to do trickery with mover constraints(especially VectorForce)
It is kinda the result, but sure will need to do rework it. Physics state is an unstable solution to a problem, because at 1 attempt I just flew out of the portal in random direction all spinning, so will need to work with VectorForce.
I think I’ll work with BodyVelocity instead
No weight is not the problem. If I enable Humanoid.Sit then it flies perfectly how needed. Problem is that Velocity just zeros out at one point without and all what remains is velocity from gravity.
The reason you flew out, is most likely related to Roblox collisions, not the Physics state.
What Physics state does is, it enables the same state as Humanoid.Sit. The only difference is, it does so indefinitely, while sit, ends after a certain time, removing the Physics state, and that’s why the Velocity zeros out. I’m quite sure the Physics state is what you are looking for if you want to preserve velocity, acc etc, but the collisions problem is different. I’d recommend not using Touched events if you use any!
You can work with BodyVelocity as well, but I believe it will not have the effect you want. BodyVelocity will impose some velocity on the character, it will not conserve some random previous velocity you had before entering the portal.
What you can do is register the exact velocity magnitude your character has, and after teleporting, set that same velocity using a BodyVelocity, but problem is in which direction? If you just use the exit portal’s normal (aka look vector), it might not behave as intended in all scenarios. But I guess you can give it a try
Hi! Is there a possibility for you to publish the code of how you did that? I’m looking everywhere on how to do it. Can’t find a solution, and I tried a lot of ways.