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"

Freezing character after overlap

Hey so I have a system where when one player overlaps another players box collision he makes that character "it". What I am trying to do is make it so when the person tags the other person the person that has just been tagged becomes frozen for 5 seconds by adjusting the max walk speed to 0. When I try setting up a system like that it freezes both characters. What do I need to do?

Product Version: UE 4.18
more ▼

asked Dec 31 '17 at 01:09 AM in Blueprint Scripting

avatar image

53 2 4 7

avatar image Vizgin Dec 31 '17 at 02:13 AM


Can you post a picture of your blueprints for that overlap event?

avatar image RpgSlayer707 Dec 31 '17 at 02:35 PM

The images are on player 1's blueprints. Player 2 and 3 have the same blueprints just adjusted for that player. The first image is Player 1 sending the tag. The second image is when Player 1 receives a tag.alt text

image1.png (107.2 kB)
image2.png (74.4 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hey there, can you show me how are you doing the freezing part?

more ▼

answered Dec 31 '17 at 02:23 AM

avatar image

6k 163 130 305

avatar image RpgSlayer707 Dec 31 '17 at 02:36 PM

I deleted my system because it was not working but what I did was in the receive after the second branch I would set speed to 0 and then delay 5 seconds before continuing.

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

Based on your blueprints, I think your approach to such problems is not a good one and you will end up in a situation with lots of duplicated code and repetition! First, let's clarify the logic you're trying to implement. As I understood, your player character has a collision box somewhere nearby or around it. I'm assuming this collision box was added as a component to your character blueprint. You want to check whether another player has entered this box, and if so, you want to freeze that other player who entered the box for some pre-specified time (I don't see any delay node in your blueprints either). If this is what you're trying to achieve, then the right way of approaching such problems is for you to consider using base classes and to take advantage of inheritance and polymorphism.

Understanding these concepts will not only make your life easier but also your blueprints setup much clearer and neater! Take a look at these two answers in here and here where I briefly explain what inheritance and polymorphism are and how to use them in the questioners' problems (You can think of these questions as examples to better understand these concepts). Having understood these concepts, regardless of whether this is a multiplayer game or not, these would be steps that you need to follow:

  1. Create a BP class based on character and name it MyBaseCharacter. This will be the base class for all your characters.

  2. Let's consider only one of your characters has a special freeze magic (that collision box) that whenever others approach it, they will freeze. Create another blueprint class but this time base it on MyBaseCharacter. Let's name it MyMagicCharacter.

  3. Add a collision box to MyMagicCharacter.

  4. Implement the following logic inside MyMagicCharacter:

alt text

There you go. What you wanted but in a much neater and cleaner way. Now whenever a player that was created based on MyBaseCharacter enters this box, they will freeze (for 5 sec in here). No need for casting to different players or calling functions from different places! The logic for freezing sits in this BP alone and whenever yourself or someone else want it, you will not have to trace it to multiple places just to figure out how it works.

Hope this helps.


Ahmad Jamialahmadi

freezeonoverlap.png (139.9 kB)
more ▼

answered Dec 31 '17 at 09:41 PM

avatar image

1.5k 10 10 18

(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