x

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. 

Launch Character node fighting with swim movement

Hi! I recently finished my first project on UE4 (it was my first game at all, actually: check some screens here if you're curious: https://www.artstation.com/artwork/YabdYY) and I've already started to create my new game - it's a sort of dungeon crawler. Well, among the various mechanics, I wanted to do that if you swim in water, the water can have a powerful enough flow to push you in the direction it's flowing. I used a simple launch character node for that - note that the actor that pushes you is the same that contains a surface material and a post processing volume, the water volume instead is a separate, overlapping object.

The problem is: when I use the Launch Character node, and then I try it out jumping into water, it pushes you in the direction it should push you - but it also does not allow you to swim up. It literally pushes you down (while it pushes it in the right direction too). I couldn't solve this problem in any way. Any idea guys? It would be super amazing to have this mechanic in the game but I really can't solve this one!

alt text

Product Version: UE 4.22
Tags:
senza-nome.png (302.1 kB)
more ▼

asked Apr 09 '19 at 12:04 PM in Blueprint Scripting

avatar image

LucaFoxArt
13 3 3

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

2 answers: sort voted first

Hey! Thanks for the help aNorthStar, you set me on the right path. When you told me launch character was setting my char movement to "falling" I realized why I was having that problem. So after some time and work I understood I had to use physics to achieve what I wanted - but I still wanted a simpler, possibly physicsless solution (especially because physics are pretty hard to control and tend to be very glitchy. So I had an illumination and came out with an alternative solution!

The solution: just add movement input to your character through the liquid BP (I used delta seconds as time input). Use a custom event that can store a vector (the flow direction) and a float (the flow strength) and it'll work perfectly! I also used a boolean to check if the player was being pushed by the flow (flow>0) and then if it was true the axis of the movement input was clamped to lower values - now it looks really realistic, the char seems to fight against the flow!

more ▼

answered Apr 10 '19 at 09:51 AM

avatar image

LucaFoxArt
13 3 3

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

welcome! :)

I'm not quite sure how your player Character component is set up for movement in water... the movement mode... but it might be your use of the Launch mode: this fires just once when it is called (its not a setting) , and then automatically sets the movement mode to "falling" (not "flying" or "swimming").

I think if you are looking into adding a constant force on your character, like a river's flow force, maybe use Force node, Impulse node or a Thruster component instead for this. The Launch node might be more useful when you are leaving the water physics volume and hopping up on land (although I think there is an automatic function for this too, either in the Character component or the physics volume)

more ▼

answered Apr 10 '19 at 03:45 AM

avatar image

aNorthStar
1k 8 17 20

(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