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"

How to freeze enemy in blueprint?

Hi! I know a method that pauses the entire game but that is no good for me. I need a blueprint that freezes only a specific AI characer group. Thanks for the answers!

Product Version: UE 4.15
Tags:
more ▼

asked Jun 19 '17 at 05:50 AM in Blueprint Scripting

avatar image

ChevCheliosSun
6 3 4 6

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

1 answer: sort voted first

Hi,

It's quite simple. There is a node called 'set pause anims' ( you need to uncheck context sensitive to see it).

alt text

Plug the skeletal mesh which contains animation into it. If you want to freeze a specific AI blueprint actor, then use a branch and check the blueprint class equal to that AI blueprint, then use the node. You may also want to Unpossess the AI after freezing, in order to stop them from rotating and casting spells. No need to mention that you need to communicate between blueprints.

Regards,

pause.png (25.6 kB)
more ▼

answered Jun 19 '17 at 10:47 AM

avatar image

navid100
991 29 14 46

avatar image ChevCheliosSun Jun 19 '17 at 06:51 PM

Thank you for the answer! In fact I'm a very beginner to UE4 and did not quite understand how to achieve this. I have a level blueprint wich contains an event ---"E" key pressed--- to pause the game. But I have other animations on the pause menu widget from a source in the level. So I need to pause only the specific AI members. So I must somehow tell the AI_Blueprint to stop moving .... from the level blueprint keypressed event.

I'm really new to this kind of programming and cannot figure it out. I was trying to press-and-hold the flow node from the levelblueprint and drag my mouse onto the AIBlueprint and expected some "magic in the background" :D This could be the next versions best improvement haha :)

avatar image navid100 Jun 19 '17 at 07:19 PM

You need to be a little moderate in blueprint scripting in order to make what you want happened. I suggest you not to rush to do complicated things if you are new to UE as you say. Instead try to do simple tasks first, watch YouTube tutorials on different parts of the engine, learn how to communicate between different BP classes and then after a while you will grasp the ability to do more complicated tasks. If you are a fast learner, I guess it would take you a couple of weeks full time to be able to achieve what you want. First you need learn how to put steady steps if you plan to be a good runner. ;D

Regards,

avatar image ChevCheliosSun Jun 21 '17 at 05:14 PM

Ok now I know something about communicating between blueprints. I managed to freeze my enemy, BUT it works now only when my enemy is in front of me. Because I use SphereTracebyChannel method. As you know it has an out hit hit actor output. Also if I set sphere radius to a high value it wont work as it expected.

The best learning process when I learn that what I want to achieve isn't it? :) So please tell me is there an other way to select all enemies_BP that is placed on a level and send them this pause anim signal through interface messaging?

By the way my new setup now is that I have a player blueprint wich listens for the esc-key, then it passes the boolian TRUE by interfaces to the enemy blueprint. As told it still uses a sphere trace wich works only if enemy is right in front of me.

Thanks a lot!

avatar image navid100 Jun 21 '17 at 06:35 PM

Actually when you use 'SphereTraceByChannel', it will affect objects in a radius from your pawn not just those which are in front of your pawn. Besides, you'd better to use a 'MultiSphereTraceForObjects' rather than a 'SphereTraceByChannel', although it's only useful when you are going to create a spatial freezing spell around your pawn. Moreover, neither will do the thing you want. What you really need is to use 'GetAllActorsOfClass' node (which selects all actors of the same class all over your level), then use a 'ForEachLoop' node and plug the array elements pin into the interface BP and inside your AI BPs, plug the interface to the node I have showed you above. But you'd better to use a cast to node instead of an interface, because in your case, it's more straight forward.

Regards,

avatar image ChevCheliosSun Jun 21 '17 at 06:39 PM

WOW it's working :) now could you help in other part of this problem? https://answers.unrealengine.com/questions/659628/how-to-possess-back-an-ai-after-unpossessing-it.html

I need to possess back those AIs...

avatar image navid100 Jun 21 '17 at 07:28 PM

Please mark the question as resolved, if this solved your problem and good luck.

(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