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 fix blueprint error for changing speed of ai based on amount of ai killed?

alt text

Hi, I get alot of errors from this branch node and dont know why.

I have a kill counter on the player BP and have referenced it in the Ai BP for when the player kills more Ai the faster the ai walking speed gets.

Product Version: UE 4.13
Tags:
untitled.png (291.5 kB)
untitled1.png (179.2 kB)
more ▼

asked Nov 04 '16 at 03:40 AM in Blueprint Scripting

avatar image

KevinNisbet
16 1 2 3

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

2 answers: sort voted first

The reason you're getting all your errors is that you are trying to access a variable out of scope.

Tick runs constantly from the time the actor is created until the actor dies.

You need to store a variable to the player controller when "OnSeePawn" triggers and the cast succeeds. Then, in Tick, you check first to make sure that variable is valid, if it's valid then you get the kill counter from it. Otherwise do nothing.

more ▼

answered Nov 04 '16 at 01:36 PM

avatar image

MajinSephiroth
1.2k 31 8 32

avatar image MajinSephiroth Nov 04 '16 at 02:46 PM

Your AI_Character needs a variable reference for FirstPersonCharacter.

In the AI_Character Tick is where you would check that variable.

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

Thanks Majin! What do you mean by out of scope? To do this would i create a variable in the firstperson_BP? Then in the ai_BP have the is valid node?

more ▼

answered Nov 04 '16 at 01:54 PM

avatar image

KevinNisbet
16 1 2 3

(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