Ref
Tutorial Video
Flying AI in 10 minutes - UE4 Tutorial
• Flying AI in 10 minutes - UE4 Tutorial
0031
add BP character =not actor -name=flying ai
0045
add component static mesh (under capsule component)
det -static mesh=cone etc
0103
add bp actor component = not actor -name=flying ai component
node=this bp can be used for different AIEs
0121
open bp ai component
add get owner/return v -add cast to character/as character -add get character movement (under character)/out -target /add set gravity scale (gravity=0.0) (under character movement component)
cast to character/out -in/SET (gravity scale)
event begin play -cast to character
0207
bp flying ai
add component = flying ai component (made above)
0217
place bp flying ai
0219
press simulate
0234
content browser -r/c -artificial intelligence -BT -name=bt_flyingAI -add BB -name=bb_flying AI
0256
open bt -det bb asset =bb (made before)
0313
bt
root -add selector -add wait
0346
bp flying ai
delete all event nodes
add event begin play -add get ai controller
-controller actor/get ai controller=self
get ai controller/return v -run BT
event begin P/out -in/run BT -bt asset =bt (made before)
Note: Don’t forget the part, SELF
0420
add bt task -name=btt fly chase player
Note=look at 0513 =name will be changed
0445
btt
add event receive execute ai
select controlled pawn/event receive.. -promote to variable -name variable =controlled pawn
0503
bt
selector -add btt fly chase player
0513
change name of BTT
name=btt_set velocity towards above player
0539
btt_set velocity towards above player
sele set (controlled pawn) -add cast to character
cast to character/as character -add get character movement -promote to variable -name=character movement ref
cast to character/out -in/set (character movement ref)
set controlled pawn/out blue pin -object/cast to character
0614
add get player character/RV -add get actor location
0627
drag character movement ref GET (component) -add set velocity (under velocity)
set (cha movement ref)/out -in/set (velocity)
Note: set velocity (under velocity) is located at the bottom of the node list
0641
sele velocity/set (velocity) -add multiply -sele B (=0.0) -promote to variable -name=speed -open EYE
-det default value speed=600
0705
sele get actor location/rv -add (+) plus -split pin -sele Z -promote to variable -name=elevation height -open EYE -det default val=300
0731
-add get unit direction (vector)/out -in/multiply
0748
drag controlled pawn (component) GET/out -add get actor location/out -from/get unit direction (vector)
sele (+) plus/out -to/get unit direction (vector)
0804
sele set (velocity)/out -add finish execute -success=ON
0813
gameplay
0837
sele set (char movement ref) -add branch
0849
copy 6 nodes
Note: look at the tutorial video
0851
sele get actor location (copied) -add equal/2nd input -out (+) plus -3rd pin/equal =50 -equal/out -condition/branch/false -in/set (velocity)
Note: disconnect line true/branch and set (velocity)
0911
true/branch -in/finish execute
Note: finish execute is connected by 2 lines
0916
copy/paste set (velocity) with character movement ref
branch/true -in/set copied set (velocity)/out -in/finish execute
0951
change the speed of AI
at bt
-sele node (purple) =btt_set velocity towards above player
-det -speed=tweak