How do I stop the camera movement when sliding? (3D Sidescroller)

hmm I recorded that with the sliding in the game, i.e. the animation in the game. As soon as I slide, the capsule shrinks to the programmed size that I set by activating the shift button…

(sorry again for that recorded music)

On the video you can see the sliding animation and the capsule component that is tied to the character, which shrinks with it or am I just misunderstanding you completely…

sorry, I really don’t want to cause you any inconvenience

1 Like

No, it’s not a problem.

Okay, let me clarify.

What I want you to do is this:

You press the button in game, and all that plays is the animation.

So, choose a different button and connect the animation to it so when you press the button, none of your other code “fires”/executes.


(And as I said, just answer when you have time, I’ll keep doing other things for the game in the meantime :slight_smile: )

Okay, perfect!

So that means that you have ROOT MOTION enabled.

What you’re going to want to do is disable ROOT MOTION.

So, go into the Animation, and look for it on the LEFT SIDE PANEL:

Now, the capsule should NOT move when the animation is playing.

I think we are getting closer to the problem

(Besides, I’m going to sleep now. I have to get out very early tomorrow. In Germany it’s now 10 o’clock in the evening sooo good night zzzz I’ll go straight back in tomorrow after work)

1 Like

OKAY!

That’s a GREAT sign.

Now you’ll need to set the capsule’s location at the location of the mesh once your mesh finishes their animation, but you’ll need to know how long your MESH’s animation is. So take a look at how long the animation is, and then put that value into a delay.

1 Like


my BP

But still he same problem as shown in the video

Hi,

The Spring Arm has the Target Offset and Socket Offset parameters.

image

I think you could use it. It’s relative to the Capsule (if you have the Spring Arm attached to the Capsule).

I’m not sure about the exact implementation without trying it out, but I would start with this:
Set Socket Offset Z value to HALF of the value of the Half Height difference
Example:
if the Half Height is 100, and during the slide its 70, the difference is 30, so socket Z value should be 15.
In this Case Socket Offset would be x = 0, y = 0, z = 15
At the end of the slide, when you change the half height back to original value, Set Socket Offset also the the original value of 0,0,0

So basically, anytime you change capsule half height - counter it with socket offset.

Again - I’m not sure about the exact values and math here, but it should point you in the right direction I hope.

1 Like

ohhh ok

That’s a very good option, I’m surprised, thanks for that, I’ll try it out IMMEDIATELY

If I understood correctly, should I include this in the blueprint?
Unfortunately I can’t find a function for the “Camera Socket” there.

Yes, but its Socket Offset, not Camera Socket

image

ok thanks i go for it

I try this now:

but still the same issue

can you show me the full picture?

1 Like



Without Socket now

(I need to train and eat away for a few hours :slight_smile: )

1 Like

I’ll leave you with @lordlolek so you don’t have too many instructions coming at you all at once!

1 Like

I really can’t say thank you often enough to Leomerya12, so thank you again for your help a second time :smiley: you’re the best ^^

1 Like

Do you have another idea about the whole thing?