Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How can I smooth the crouching with BP?

I'm having issues figuring out how to smooth the animation in crouching using BP. From researching one the forums/Answerhub it looks like people are saying use vinterp. I've attached a screenshot of what I'm trying. Can someone help me out with this, (give me some advice) please? alt text

Product Version: Not Selected
crouchbp.png (169.2 kB)
more ▼

asked Jun 14 '14 at 05:30 PM in Blueprint Scripting

avatar image

3 3 6 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

There are some things you are doing wrong there.

First, you are interpolating to world space 0,0,32 or 0,0,64. You need to add or subtract that amount from the actor location.

Second, Interp works by being constantly executed so you should connect that to a Tick and have it update based on a conditioned toggled by the crouch key.

Also, connect the Delta time node in Tick to the ones in InterpTo.

more ▼

answered Jun 14 '14 at 05:47 PM

avatar image

1k 42 28 65

avatar image ViralCrux Jun 14 '14 at 05:59 PM

Ok so I was able to get the smooth effect, even though I'm not sure how to decrement the counter int one vInterp loop. How can I change this to just move the z location of the camera? Right now my whole body sinks into the ground. Also, how would I decrement the counter each VInterp loop? Better yet how could I set the Counter to the z coor of the camera location?

alt text

crouchbp_3.png (211.9 kB)
avatar image ViralCrux Jun 14 '14 at 07:49 PM

I'm getting closer. I'm still having the issue where I can't just move the camera, so my whole actor moves into the ground. The event tick is also firing right off the bat so I'm not sure how to fire it on input.

Here's another screenshot.

alt text

crouchbp_4.png (242.3 kB)
avatar image dissonanceint Jun 14 '14 at 08:29 PM

The uncrouched Set location should also be Tick driven since Interp doesn't work on a single event.

Now, moving the character is not going to work. By moving it down or up, you are impaling it to the ground or levitating it. You want to use the same logic but changing the player camera's location.

crouchbp_5.png (461.3 kB)
avatar image ViralCrux Jun 14 '14 at 11:34 PM

Ok, I figured out how to set the get/set camera relative location. Now the issue I'm having is there can only be one tick event. How do I spread this across two Vinterps? Also, the crouch fires on start, rather than when I push the crouch key. How do I set the tick to activate on key press?

alt text

crouchbp_5.png (461.3 kB)
avatar image dissonanceint Jun 15 '14 at 12:21 AM

The Tick is an event that happens every frame. The input crouch is supposed to change a bool in a branch connected to tick or open a gate connected to tick. You could have a branch set by a bool "IsCrouching", true being the Interpto crouched and false being the Interpto Stand. IsCrouching would be toggled by your crouch key. Also, this will only change the camera position and it won't do anything with capsule component height. You would have to change that manually and I'm sure you can find something by searching around.

avatar image ViralCrux Jun 15 '14 at 12:36 AM

Ok I think I understand what you're saying. This is what I have for the Camera change. It seems to be working for the most part the camera is a bit jumpy at the start of each. Perhaps because baseEyeHeight and my Uncrouched/Crouched variables don't match up. I'll have to work on that now. Your help/guidance is very much appreciated so thank you!

Edit: It looks like the camera auto jumps. When I hit crouch the camera instantly drops to the crouch position then does the vinterp down another 32 beyond that. Just the opposite happens when I release.

Edit 2: I figured it out I just got rid of the built in crouch and IsCrouched. I created my own boolean to control it.


alt text

crouchbp_6.png (234.3 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question