Announcement

Collapse
No announcement yet.

Footsteps

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    [QUOTE=Vini Cortez;n1738655]Awesome, thanks marco that will help a lot, also, I will give a little contribution, if you don't want the footstep to play when not on top of a surface(jumping), you can do this:

    Appreciated! :-)

    Leave a comment:


  • replied
    Awesome, thanks marco that will help a lot, also, I will give a little contribution, if you don't want the footstep to play when not on top of a surface(jumping), you can do this:

    Click image for larger version

Name:	Screenshot_3.jpg
Views:	63
Size:	494.9 KB
ID:	1738656

    Leave a comment:


  • replied
    mandango Thanks for your contribution!

    Leave a comment:


  • replied
    Interesting thread. To add my little contribute, create a customized CUE for each foot step with differents sounds to play randomly

    https://snag.gy/WA3Js4.jpg

    https://snag.gy/JDax04.jpg
    Last edited by mandango; 12-12-2017, 09:48 PM.

    Leave a comment:


  • replied
    Originally posted by tcla75 View Post
    ... if anyone wants to have different sound steps for wood grass carpet and so on just add the following code on the end of Marco's bp The default footstep sound below is a variable I added. In the variable type search for sound base then put your default footstep in there. It will ensure if you walk over a material that doesn't have a phys material assigned to it a regular step will still play.
    Well done! Thanks for sharing back with the community. :-)

    Leave a comment:


  • replied
    Originally posted by vr_marco View Post
    tcla75 you are welcome!

    Even made an improved tutorial for you here

    Wow thats amazing thats going to help a lot of people Marco and just to add a screen based on what you said if anyone wants to have different sound steps for wood grass carpet and so on just add the following code on the end of Marco's bp The default footstep sound below is a variable I added. In the variable type search for sound base then put your default footstep in there. It will ensure if you walk over a material that doesn't have a phys material assigned to it a regular step will still play.
    Click image for larger version

Name:	Capture0.JPG
Views:	102
Size:	172.9 KB
ID:	1398074

    Leave a comment:


  • replied
    tcla75 you are welcome!

    Even made an improved tutorial for you here

    ​​​​​​​

    Leave a comment:


  • replied
    Originally posted by vr_marco View Post
    In case you are still struggling with it, here is the full solution which works in the FPS template (also in VR mode). It has a couple of improvements respect to what I described above:

    1) An initial check prevents a stray step sound as soon as the game plays
    2) Alternate sounds for left and right foot

    Step Distance is set to 125.0 which seems to work well with the gun animation also out of VR mode, but you can play with that value and see what feels good to you. Have fun!

    Click image for larger version

Name:	Footstep_sounds.png
Views:	104
Size:	199.5 KB
ID:	1397798
    Thats perfect. Thanks

    Leave a comment:


  • replied
    In case you are still struggling with it, here is the full solution which works in the FPS template (also in VR mode). It has a couple of improvements respect to what I described above:

    1) An initial check prevents a stray step sound as soon as the game plays
    2) Alternate sounds for left and right foot

    Step Distance is set to 125.0 which seems to work well with the gun animation also out of VR mode, but you can play with that value and see what feels good to you. Have fun!

    Click image for larger version

Name:	Footstep_sounds.png
Views:	104
Size:	199.5 KB
ID:	1397798

    Leave a comment:


  • replied
    Good, you are almost there!
    Answers:
    (1) yes!
    (2) no, you have to add the Length of the difference vector to Distance and assign (Set) the total to Distance. Basically you keep adding the magnitude of the last movement to Distance until (3) is true.
    (3) no, you have to compare Distance with StepDistance, not with itself. StepDistance is a new float var you set to, say, 50 (meaning one step sound every 50 cm of movement). And between Set Distance and the Branch, you need to assign (set) Get Actor Location to Last Position so you are ready for the next frame. Remember you are working into an Event Tick.
    (4) After you have produced the step sound, you have to assign (Distance - StepDistance) to Distance. The symbol := means assign to or, in UE4 terminology, Set. This is needed to reset the Distance variable and restart adding to it until the next step occurs.
    Last edited by vr_marco; 12-09-2017, 05:33 PM.

    Leave a comment:


  • replied
    Originally posted by vr_marco View Post
    You have to subtract the two vectors, so the node it use is Vector - Vector.
    https://docs.unrealengine.com/latest...r_2/index.html
    Then you take the length of the difference vector above and add it to the curent Distance (with a Set). In pseudo-code:
    Distance := Distance + Length(GetActorLocation() - LastPosition)
    Then you check if Distance > StepDistance and if true you make a step sound. After making the step sound you do
    Distance := Distance - StepDistance
    so you are ready for the next step.
    OK I think I'm close but I'll need your help answer a few questions and if you can answer each one I think I should get it then.

    (1) When you say "You have to subtract the two vectors, so the node it use is Vector - Vector." Do you mean this?

    Click image for larger version  Name:	Capture9.JPG Views:	1 Size:	12.6 KB ID:	1397684
    Yes or no?

    (2) When you say "Then you take the length of the difference vector above and add it to the curent Distance (with a Set)." Do you mean this?

    Click image for larger version  Name:	Capture10.JPG Views:	1 Size:	31.1 KB ID:	1397685

    If you didn't mean to set the distance float then can you tell me exactly what you mean by current distance (with a set) how do I know what the current distance is?

    (3) When you say "Then you check if Distance > StepDistance and if true you make a step sound." Do you mean this?
    Click image for larger version  Name:	Capture11.JPG Views:	1 Size:	65.0 KB ID:	1397686

    (4) What does this ":=" mean?
    Attached Files
    Last edited by tcla75; 12-09-2017, 12:10 PM.

    Leave a comment:


  • replied
    You have to subtract the two vectors, so the node it use is Vector - Vector.
    https://docs.unrealengine.com/latest...r_2/index.html
    Then you take the length of the difference vector above and add it to the curent Distance (with a Set). In pseudo-code:
    Distance := Distance + Length(GetActorLocation() - LastPosition)
    Then you check if Distance > StepDistance and if true you make a step sound. After making the step sound you do
    Distance := Distance - StepDistance
    so you are ready for the next step.
    Last edited by vr_marco; 12-09-2017, 05:19 AM.

    Leave a comment:


  • replied
    Originally posted by vr_marco View Post
    I meant calculate the vector difference between GetActorLocation and Last Position (there was a minus sign in between them in my original message but could have easily been missed)

    The Length of this difference vector is the moved distance
    Hi I'm sorry I don't think I explained ,myself properly. You only mention 4 nodes. The event tick, a vector which is called Last Position, a float which is called Distance and getactorlocation. I don't know what node to plug the getactorlocation into. How do I connect the GetActorLocation node and Last Position vector. Using vector difference? Which node is this? How do I connect the getactorlocation node to the event tick. There must be other nodes I have to use that you are not mentioning? Here is a picture to better explain what I mean.
    Click image for larger version

Name:	Capture5.JPG
Views:	119
Size:	53.4 KB
ID:	1397517
    Click image for larger version  Name:	Capture4.JPG Views:	1 Size:	146.9 KB ID:	1397516
    Last edited by tcla75; 12-08-2017, 08:10 PM.

    Leave a comment:


  • replied
    I meant calculate the vector difference between GetActorLocation and Last Position (there was a minus sign in between them in my original message but could have easily been missed)

    The Length of this difference vector is the moved distance

    Leave a comment:


  • replied
    Originally posted by vr_marco View Post
    Create two variables, Last Position as Vector and Distance as Float. On Pawn movement (or Event Tick), calculate GetActorLocation - Last Position. The length of this vector is the moved distance. Add it to Distance and check whether Distance > Stride Length. If so, make a foot step sound and subtract Stride Length from Distance, so you are ready for the next step. Of course this only makes sense with Thumbstick locomotion, not with teleportation.
    Hi I am trying to put together this BP but now that I am trying I'm finding there are a few missing pieces or misunderstanding on my part. OK so I have created the two variables. Last position as a Vector and distance as a float.

    Click image for larger version

Name:	Capture.JPG
Views:	118
Size:	5.7 KB
ID:	1397492

    Pawn movement would be a bit tricky with the pawn I'm using so I'll go with event tick. Now you say to "calculate the getactorlocation node - last position" but what do you mean by calculate?
    Click image for larger version

Name:	Capture1.JPG
Views:	115
Size:	12.1 KB
ID:	1397493
    The Last Position vector doesn't connect to the get actor location node so there must be another node that you didn't mention that allows me to do that. To "Calculate" it. I don't know what node to use so that is where the gap in my knowledge comes in.

    Now I think I know what you mean by "The length of this vector is the moved distance. Add it to Distance and check whether Distance > Stride Length. If so, make a foot step sound" which are these nodes.

    Click image for larger version

Name:	Capture2.JPG
Views:	116
Size:	54.9 KB
ID:	1397495

    But when you mention "and subtract Stride Length from Distance, so you are ready for the next step." again I'm not sure what nodes I would use here and where to plug them in.

    Lastly I think I have got the Line Trace By Channel for different footstep sounds right but I can't check until I figure out that 1st part and what you want me to do with the getactorlocation node.

    Click image for larger version

Name:	Capture3.JPG
Views:	114
Size:	79.8 KB
ID:	1397496
    Attached Files

    Leave a comment:

Working...
X