How to detach HRP from Character temporarily without breaking anything

  1. What do you want to achieve?
    I am trying to detach the HumanoidRootPart from character temporarily (it will need to be attached back later)

  2. What is the issue? Include screenshots / videos if possible!
    I am unable to find a way to do that.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried disabling HumanoidRootPart.RootJoint which works but if I stop moving it makes you fall down which is not ideal, it also sometimes glitches like seen in the video. I had to set HRP.CanCollide to true otherwise the player would fall trough the map.
    I also tried to clone humanoidrootpart and make a fake one for the duration that it’s detached but it didn’t change anything.

This is the current logic

	if root.RootJoint.Enabled then
		local clone = root:Clone()
		clone.Name = "   .   "
		clone.Parent = stand_user.user
		root.CanCollide = true
		root.RootJoint.Enabled = false
		local clone = stand_user.user:FindFirstChild("   .   ")
		if clone then clone:Destroy() end
		root.RootJoint.Enabled = true
		root.CanCollide = false

[This is what’s happening when using this]
It sometimes also works flawlessly except for the falling down part and bugged jumping like in [this video].


I don’t know why you need to detach the HumanoidRootPart to make a stand system… I’ve made one before from a youtube tutorial and you don’t need to touch the HRP. May I ask why you want to detach it?

I want to implement a pilot mode and it seems to be the most straight forward way to do it

1 Like

Oh like piloting the stand like how some are able to be piloted by their users from long distances?

Yes, basically the player can press a button to toggle pilot mode on their stand and if it’s on they control the stand rather than themselves

1 Like

I think a good way to do this would be to first freeze the players controls. This way, while piloting the stand, they cannot move their character at the same time as the stand. (Here is a link on how to disable specific keys.)
Then, you can use CameraUtil (or if you would prefer to write a camera controller from scratch) to lock the players camera to a part on the stand, so the camera follows the stand instead of the player.
You can write a custom stand controller to allow the stand to move. I can’t really help you there because I’m not 100% sure on how you could emulate the moving part for the stand, but that could work.

I guess another way you could do it if you cant figure that out is to make a clone of the player and just set the players character to be the stand.

Edit: You could use the new Force instances to pilot the stand, maybe try a VectorForce?

I can’t really implement it this way since the stand does not exist on the server (each client creates his own copy and gets instructions via remote events on what to do with it) and cloning the stand model each time the player presses the pilot button seems a bit much (I want it to have a very short cooldown if any). I could create a “new” root and make the camera follow it but again it’s would be much simpler if I could just use what Roblox provided and detach the root from the body temporarily.
I was thinking about it and it’s the most straight forward solution and one that requires least of weird work arounds from what I can tell.
Basically the plan is to:

  • Disable some moves that I don’t want to be usable while in pilot mode
  • Detach the HRP from the body (the body will still stand and exist, but since HRP is detached it won’t move)
  • Tell every client to move the stand into the position of HRP (it works on attachments so just set position to (0,0,0))
  • If player wants to go back to his character just undo the steps

With this approach I don’t have to attach an additional hitbox to the stand (to make it attackable) since HRP is inside of it and I don’t have to clone anything (at least nothing big like character model or stand model) and the movement is already implemented for me by Roblox.

1 Like

Oh I see. I don’t really know if it’s possible to detach the HRP… I’d also make the stands on the server because I feel like its a lot of work to send that information back to all of the other clients.

Wanted to do that but the player needs network ownership of the stand and it just seems unsafe (?). I’m sure the big JoJo games have the stands on the server side but I can’t figure out how they prevent people from just manipulating the stands position (since the the stand is network onwned by the player). Doing distance checks seems like a bad idea since I use AlignPosition (maybe it’s not correct me if I’m wrong)

Stand position is important since all of the attack animations are played on the stand and if an exploiter just puts it underground somewhere it will be impossible for another player to for example know when to block/parry.

Also it’s not really a lot of info (at least for right now) since all I need to send is the offset at which the stand needs to be, and a client can ask for “update” which sends him all the necessary info (for example client got remote to play an animation on a stand model but stand isn’t there, so the client asks for update which should make the server tell this client to create the stand model and update other potentially missing stand models)

1 Like

Hmm yeah, that is a difficult problem. I don’t really know how to help you with exploiting problems when it comes to combat…

Okay thank you for your answers anyway!