I think I didn’t read the post properly originally,
however if you were to have a separate AnimationController for the cube,
I think it could work.
You could also weld the HumanoidRootPart to the cube, yes.
Alright, well I tried using the welding method with an separate animationcontroller for the cube, this is the result.
The cube (along with it’s group and HRP equivalent) just disappears after roughly 2 seconds. Even if I don’t play any animations, it still just vanishes. I tried checking both part’s position to see if one was falling into the void, not the case.
I have no idea what’s causing this.
Furthermore, the humanoidrootpart isn’t being moved regardless, even if I make the animation play straight away.
The HumanoidRootPart isn’t intended to be moved in an animation, only the limbs of the character are. If you want to move the character to a new position, during an animation, you will need to apply body forces or set the CFrame of the root forward into a certain position.
This is the same way Roblox implements the jump animation. When you perform a jump, the animation is ran in an idle position where the character performs the jump motion but they don’t actually move in the animation. The player movement is actually done by an intern upwards force whereas the animation is just meant to visualise that the Humanoid is in the process of applying the initial upward force.
Weld was being done locally, so it was in fact falling on my screen. Now it no longer falls. Problem persists, however; weld still does not move the character. WIll try a few more things.
Edit: @colbert2677 please re-read thread thoroughly. I am not trying to move the humanoidrootpart with an animation, but along with an animation (a third party object the humanoidrootpart is welded to, for instance)
Sorry, your thread isn’t quite clear on the first read through. There’s also a lot of text which makes sifting through your intended implementation more difficult.
I don’t think that very much changes about my response even then, it’s just that bits of the post don’t fit the bill correctly and with a little bit of change in interpretation of the post, it probably should make sense towards your case. I think?
AlignPosition should be working for you here and I do know that systems have been accomplished using it (e.g. custom character controller uses it to keep players to inverted surfaces). Interesting that it hasn’t worked out for you. I’ll try testing around with that later and let you know if I get anything conclusive unless you find a solution before then.
Hold on, let me provide you with a rblx file for this.
Edit:The cube rig itself is located in startercharacterscripts.
The xSIXxAnimationSaves folder inside of the dummy contains a single animation, but depending on whether or not you put it in the companion model or in the dummy, it gives you the corresponding animation. (slash and cube moving). Use those to upload the animations.AnimationTest.rbxl (24.1 KB)
What would be your final goal after you figure this out?
Like what are you planning to do?
I’m slightly unclear what your use-case is, and it’d help out me and maybe others to know.
I’ve provided an use case example in original post. Any attack or action that requires movement, basically. Like using a jump slash to reach a higher ledge or ducking a few studs to the left before coming back and striking a player (Which would be exploitable for greater mobility during fights if a player were to turn 180 mid duck, making the game more skill based). I don’t want to use velocity or bodymovers because they don’t allow for finer movements and would generally be much more time consuming than simply being able to draw the path of a player via animations.
It seems that you could use body forces to achieve these actions.
Is there anything that prevents you from using body forces?
Sorry if you’ve previously answered this, it’s just slightly unclear for me.
It does not allow for finer movements. What I’m trying to achieve is something like this
where the movement is really smooth and (I am fairly certain) that it is using animations to move the humanoidrootpart.
If you’ve played breath of the wild, think of link’s spin attack, except going around in a spiral. Bodymovers would most likely not allow for this, not without overcomplicating the code a tad.
Ooh, yes, DahNoob’s work. Lovely stuff.
IIRC he doesn’t use animation objects at all and his work isn’t FE compatible, they’re created through lerping on the client. If you’re familiar with old script builder script powers, all the animations were done using hard coded CFrame cycles.
I know he uses MAS occasionally (he’s also in the Discord) but I’ve never found any published animations and I believe that was only a one-time thing where he mentioned trying out animations for a certain tool in an old Twitter post.
That can be achieved by using body movers.
The way you’d be doing this with body movers would be to have an animation that doesn’t actually move around. Then you get the CFrame from HumanoidRootPart, the LookVector from the CFrame (based on a sword lunge), and you create a BodyVelocity (LinearVelocity once that comes out). Now the BodyVelocity’s velocity should be set to the LookVector * Speed_of_the_lunge
. You should also remember to set the MaxForce to something like Vector3.new(1, 1, 1) * math.huge
, so that it actually allows the BodyVelocity to move.
Edit: Also if there’s a limitation/problem with using body movers, please do tell me as it would be really useful as I work with body movers a lot.
Edit 2: The animations seem to be near instant when it starts and stops, this can be achieved by playing around with the first parameter of AnimationTrack:Play
and AnimationTrack:Stop
. For more information, here’s a developer hub article.
MAS? Also if it isn’t FE compatible, I’d still like to achieve something as close to it in terms of smoothness as possible with FE enabled.
Edit: @guidable LinearVelocity isn’t a body mover. Someone linked it earlier but it lead to a default article. I think you’re thinking of bodyvelocity?
Moon Animation Suite.
You can make it FE compatible by having each client animate characters on their own end. The client would just need to use the server as a medium to tell other clients to perform a certain animation cycle. This would be necessary since lerps don’t replicate.
I don’t know the specific implementation details at all, so sorry I won’t be able to help you in that capacity.
Oh. I just wasn’t familiar with the acronym. It’s what I used to animate the example. Lerping each frame is kind of irrelevant in my use case, however. Nothing’s stopping me from just loading it as an animation. I’m more so interested in making the player move along.
I have somewhat of experience with the implementation of such a system, just with welds.
It’s pretty easy to make such a system, but I don’t really recommend doing such as it is easily exploitable,
and often times it’s just much easier to do it using animations.
When I started using animations instead of this so said weld system,
I found it much easier to do with the animations.
I’ll create a small prototype for lunging using animations + body movers this upcoming week
and I’ll share it.
I’ve tried setting velocity directly, lead to the player being able to go way too far if they’re not grounded. Tried tweening a bodyvelocity’s maxforce down, causes the player to float for a bit during the animation (which I want to avoid). Trying weld didn’t work, alignments didn’t work, etc. Kind of at a loss for what to do.
The player floating issue can be countered by setting the BodyVelocity’s MaxForce Y axis to 0.
I’m starting work on the quick prototype of “movement-lunging”.
I don’t expect it take too long, like 1-2 hours.
Regarding the player going too far if not grounded is a somewhat easy fix, just apply air resistance to the HumanoidRootPart during the action. Welds and alignment constraints are unnecessary and isn’t the best fit for this case.
So I’ve achieved a somewhat similar lunge as DahNoob had, without all the fancy effects and animations.
Essentially it’s just a simple movement lunge.
I’ve uncopylocked the game so you can check out the code, sorry about the code being slightly messy.
The way I went with this was to have a BodyVelocity, and set the Humanoid.AutoRotate to false and not let the player move at all. I also made the lunge length pretty low, and pretty fast.
It’s probably not the best looking thing ever, however it does the job and I feel like it’s something like this you want?
Unfortunately I couldn’t get any gifs.
What about teleporting the humanoidrootpart to the torso? Idk