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

Hello dear friends, unfortunately I’m not a programmer and I’m very new to unreal.
I made a video for you about my problem.
(thanks in advance for anyone who looks and tries to help me)

I know that the problem is that the character’s capsule shrinks when it slides and since the camera is tied to the capsule it moves with it.

I just have no idea how exactly this should be installed with the “relative location” of the camera or the capsule.

First of all, here are the pictures of my slide system:



and here my noob trying to get the whole thing done :(:

It would be very nice if someone could show me pictures in unreal because im to new to make this done by my self… I am very grateful to you

1 Like

:confused: no body here for healp :(?

Hello, again!

When you slide, your capsule’s HALF-HEIGHT changes.

This means that everything else attached to the CAPSULE will follow it (including the camera).

So, you’ll need to get rid of the HALF-HEIGHT node…

AND/OR

Instead of adjusting the capsule’s VECTORS, you adjust the mesh’s vectors instead.

I know, nothing is simple.

Heeeeeyyyy Leomeray12!!!
:smiley:
haha yes but thanks I’m trying to find a way around what you said

1 Like

Keep me posted.

Don’t you think there could be a way to simply tie the spring arm to the old position as soon as I slide?

I was told this in another forum:

Maybe?

The issue I think you could run into is that it’ll go up and down really fast.

Not sure though. You can try it.

The only problem is that when I add “Add Relative Location”, it is added again and again as soon as I press something…

That’s why I’m stuck on this point right now
I don’t think the whole thing should work with “Add Relative Location”, or what do you think?
Do you perhaps know of another function in the blueprint that would not add this every time, but would only be executed once each time?
I will test it maybe with “do once”
but I think then it stays in the added state

(ok do once do not work because i cant slide anymore after it)

I would honestly just get rid of all that logic and start over.

Do NOT touch the capsule component.

Can you upload a video of the character performing the animation montage so I can see if the mesh changes height on its own?

1 Like

i made one video in the top of the post but the background is bad
one sec.


Oh sorry for the music i dont now why it records with lol

Oh, I meant without any of the code. I just want to see the animation montage. (Also, I’m working on my own project, so bear with me.)

Wait, it worked?

Don’t stress yourself, just answer when you have time :smiley:
I’m glad I got any help at all, so everything’s ezy^^

So this is now the pure montage, not in the game’s play mode, but the camera moves with the game, so as soon as I’m in play mode, I don’t know exactly whether we’re on the same page

What happens when you unplug the capsule half-height?

(Make sure whatever it was attached to gets attached to the LEFT_SHIFT.)

Yes, then it would work, but how am I supposed to slide under things?

So when I slide, I just want to slide under obstacles and that only works as far as I understand the whole thing now if the capsule shrinks.

(Sorry for the weird English, I’m using Google Translate)

Ah, you mean that there is a collision when you slide?

Now it gets “fun”.

You’ll need to move the CHARACTER MESH instead of the CAPSULE. (Actually, you don’t have to move the character’s mesh at all! Just allow the MONTAGE to play.)

So, the character will slide forward but the capsule is going to stay in the same spot, then on the last frame of the slide, you are going to set the capsule’s location to be where the character’s body is.

Does that make sense?

Ha! Had no idea.

EDIT: When the character does ONLY their Animation Montage, does the capsule move or stay in the same place?

The problem with this would be that even if only the character’s mesh slides forward, the character’s Capsule Collsions Box will definitely show over the size of the mesh, do you know what I mean?

It would still get caught on an obstacle… :confused:

Sure, if I were to program this with the capsule halfway up, then I wouldn’t change anything about the capsule as soon as I play the montage and press the slide button

Well, it depends on the animation, which is why I asked to see it.

I need to see the animation, BY ITSELF, in your game (with the CAPSULE COMPONENT visibility ON… which you have, at the moment.)