Enemey sight/ai

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":-180,"y":424,"group":"3b32d31178c12442","id":"3b32d312ed63254e"},{"inputCount":2,"outputCount":3,"name":"Proximity","behaviorType":"logic.components.Prox2","x":0,"y":432,"group":"3b32d31178c12442","id":"3b32d312b463f14f","targetEntityId":0,"threshold":90,"targetClassId":18035393,"nearestOnly":false,"firstObject":true,"allObjects":false,"contains":false,"shape":0,"oX":0,"oY":0,"pin":false},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":180,"y":464,"group":"3b32d31178c12442","id":"3b32d3129551464d","_startVal":0,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":360,"y":464,"group":"3b32d31178c12442","id":"3b32d312ab5c4a49","_startVal":0,"dataType":2},{"inputCount":3,"outputCount":2,"name":"RayCast","behaviorType":"logic.components.RayCast","x":180,"y":568,"group":"3b32d31178c12442","id":"3b32d313c9e8db41","targetClassId":18057383,"direction":0,"length":10000,"earlyOut":false,"oX":0,"oY":0,"pin":true},{"inputCount":3,"outputCount":3,"name":"Animation","behaviorType":"logic.properties.Animation","x":720,"y":584,"group":"3b32d31178c12442","id":"3b32d313c7d67d4b","animationName":"Walk","priority":0},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":540,"y":472,"group":"3b32d31178c12442","id":"3b32d3134c42094b","startVal":1,"tag":"","roundMode":1},{"inputCount":3,"outputCount":3,"name":"Velocity","behaviorType":"logic.properties.Physics","x":720,"y":448,"group":"3b32d31178c12442","id":"3b32d3137050104d"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":540,"y":376,"group":"3b32d31178c12442","id":"3b32d3132551fc43","startVal":0,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":180,"y":656,"group":"3b32d31178c12442","id":"3b32d313e7155a40","tag":"Player X:Number","version":2,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Global","behaviorType":"logic.logic.Global","x":180,"y":784,"group":"3b32d31178c12442","id":"3b32d31357257e45","tag":"Player Y:Number","version":2,"dataType":2},{"inputCount":2,"outputCount":1,"name":"PointAt","behaviorType":"logic.components.PointAt","x":540,"y":744,"group":"3b32d31178c12442","id":"3b32d313a71a4943","skipRot":false},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":360,"y":632,"group":"3b32d31178c12442","id":"3b32d314c2638540","_startVal":0,"dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":360,"y":768,"group":"3b32d31178c12442","id":"3b32d3148903f549","_startVal":0,"dataType":2},{"inputCount":2,"outputCount":1,"name":"PointAt","behaviorType":"logic.components.PointAt","x":360,"y":872,"group":"3b32d31178c12442","id":"3ad06f0f0e92c04b","skipRot":true}],"links":[{"input_id":"3b32d312b463f14fi1","output_id":"3b32d312ed63254eo0"},{"input_id":"3b32d313c9e8db41i2","output_id":"3b32d312ed63254eo0"},{"input_id":"3b32d312b463f14fi1","output_id":"3b32d312ed63254eo0"},{"input_id":"3b32d3129551464di1","output_id":"3b32d312b463f14fo0"},{"input_id":"3b32d3129551464di2","output_id":"3b32d312b463f14fo0"},{"input_id":"3b32d3129551464di1","output_id":"3b32d312b463f14fo1"},{"input_id":"3b32d3129551464di2","output_id":"3b32d312b463f14fo1"},{"input_id":"3b32d3132551fc43i1","output_id":"3b32d312b463f14fo2"},{"input_id":"3b32d3129551464di0","output_id":"3b32d312b463f14fo2"},{"input_id":"3b32d3129551464di0","output_id":"3b32d312b463f14fo2"},{"input_id":"3b32d3129551464di1","output_id":"3b32d312b463f14fo0"},{"input_id":"3b32d3129551464di1","output_id":"3b32d312b463f14fo1"},{"input_id":"3b32d3129551464di2","output_id":"3b32d312b463f14fo0"},{"input_id":"3b32d3129551464di2","output_id":"3b32d312b463f14fo1"},{"input_id":"3b32d312ab5c4a49i2","output_id":"3b32d3129551464do0"},{"input_id":"3b32d312ab5c4a49i0","output_id":"3b32d313c9e8db41o0"},{"input_id":"3b32d312ab5c4a49i1","output_id":"3b32d313c9e8db41o1"},{"input_id":"3b32d312ab5c4a49i2","output_id":"3b32d3129551464do0"},{"input_id":"3b32d3134c42094bi1","output_id":"3b32d312ab5c4a49o0"},{"input_id":"3b32d313c9e8db41i0","output_id":"3ad06f0f0e92c04bo0"},{"input_id":"3b32d313c9e8db41i2","output_id":"3b32d312ed63254eo0"},{"input_id":"3b32d312ab5c4a49i0","output_id":"3b32d313c9e8db41o0"},{"input_id":"3b32d314c2638540i0","output_id":"3b32d313c9e8db41o0"},{"input_id":"3b32d3148903f549i0","output_id":"3b32d313c9e8db41o0"},{"input_id":"3b32d312ab5c4a49i1","output_id":"3b32d313c9e8db41o1"},{"input_id":"3b32d314c2638540i1","output_id":"3b32d313c9e8db41o1"},{"input_id":"3b32d3148903f549i1","output_id":"3b32d313c9e8db41o1"},{"input_id":"3b32d313c7d67d4bi0","output_id":"3b32d3134c42094bo0"},{"input_id":"3b32d313c7d67d4bi1","output_id":"3b32d3132551fc43o0"},{"input_id":"3b32d3134c42094bi1","output_id":"3b32d312ab5c4a49o0"},{"input_id":"3b32d3137050104di2","output_id":"3b32d3134c42094bo0"},{"input_id":"3b32d313c7d67d4bi0","output_id":"3b32d3134c42094bo0"},{"input_id":"3b32d3137050104di2","output_id":"3b32d3134c42094bo0"},{"input_id":"3b32d3137050104di2","output_id":"3b32d3132551fc43o0"},{"input_id":"3b32d3132551fc43i1","output_id":"3b32d312b463f14fo2"},{"input_id":"3b32d3137050104di2","output_id":"3b32d3132551fc43o0"},{"input_id":"3b32d313c7d67d4bi1","output_id":"3b32d3132551fc43o0"},{"input_id":"3b32d314c2638540i2","output_id":"3b32d313e7155a40o0"},{"input_id":"3ad06f0f0e92c04bi0","output_id":"3b32d313e7155a40o0"},{"input_id":"3b32d3148903f549i2","output_id":"3b32d31357257e45o0"},{"input_id":"3ad06f0f0e92c04bi1","output_id":"3b32d31357257e45o0"},{"input_id":"3b32d313a71a4943i0","output_id":"3b32d314c2638540o0"},{"input_id":"3b32d313a71a4943i1","output_id":"3b32d3148903f549o0"},{"input_id":"3b32d314c2638540i0","output_id":"3b32d313c9e8db41o0"},{"input_id":"3b32d314c2638540i1","output_id":"3b32d313c9e8db41o1"},{"input_id":"3b32d314c2638540i2","output_id":"3b32d313e7155a40o0"},{"input_id":"3b32d313a71a4943i0","output_id":"3b32d314c2638540o0"},{"input_id":"3b32d3148903f549i0","output_id":"3b32d313c9e8db41o0"},{"input_id":"3b32d3148903f549i1","output_id":"3b32d313c9e8db41o1"},{"input_id":"3b32d3148903f549i2","output_id":"3b32d31357257e45o0"},{"input_id":"3b32d313a71a4943i1","output_id":"3b32d3148903f549o0"},{"input_id":"3ad06f0f0e92c04bi0","output_id":"3b32d313e7155a40o0"},{"input_id":"3ad06f0f0e92c04bi1","output_id":"3b32d31357257e45o0"},{"input_id":"3b32d313c9e8db41i0","output_id":"3ad06f0f0e92c04bo0"}]}}}

Paste this in the follow bundle and delete the old code. I just upgraded it a bit.

for some reason when you move kinda far away he stops following you

oh it was the proximity

1 Like

Changed it but now HE SEES THROUGH WALLS UGH

If you want him to follow you only when you get close, then use a smaller proximity circle.

Sorry, it’s beyond me how to make the flipping instead of the Point At, sorry! It’s harder than I thought. JR01 might’ve made a bundle that could help, but I can’t put my finger on. Sorry again.

also do you have a discord we could talk on, i guess code wouldnt work but just talking would

1 Like

thats fine, haha have to add mroe characters

1 Like

Use JR01’s angle to velocity bundle, so he does not spin. Unless you don’t mind it.

1 Like
{"data":{"behavior":{"v":"2","nodes":[{"inputCount":2,"outputCount":2,"name":"AngleToSpeed","behaviorType":"logic.NodeGroup","x":540,"y":128,"id":"424bfc4b14307742","notes":null,"isMenuItem":false},{"expression":"B*Math.cos(A*(Math.PI/180))","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":1,"tag":"Cos","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":720,"y":640,"group":"424bfc4b14307742","id":"424bfc4ce0b5bd48"},{"expression":"B*Math.sin(A*(Math.PI/180))","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":2,"version":1,"tag":"Sin","inputCount":3,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":720,"y":768,"group":"424bfc4b14307742","id":"424bfc4c41ec7e49"},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":360,"y":640,"group":"424bfc4b14307742","id":"424bfc4c9f75d54d","portId":"424bfc4b14307742i0","tag":"Angle","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":540,"y":768,"group":"424bfc4b14307742","id":"424bfc4c2bb36345","portId":"424bfc4b14307742i1","tag":"Speed","dataType":2},{"expression":"((A%360)+360)%360","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":1,"version":1,"tag":"Angle","inputCount":2,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":540,"y":640,"group":"424bfc4b14307742","id":"424bfc4c8189a646"},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":900,"y":640,"group":"424bfc4b14307742","id":"424bfc4c4acbed4c","portId":"424bfc4b14307742o0","tag":"X","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":900,"y":768,"group":"424bfc4b14307742","id":"424bfc4cb243e94f","portId":"424bfc4b14307742o1","tag":"Y","dataType":2}],"links":[{"input_id":"424bfc4c4acbed4ci0","output_id":"424bfc4ce0b5bd48o0"},{"input_id":"424bfc4cb243e94fi0","output_id":"424bfc4c41ec7e49o0"},{"input_id":"424bfc4c8189a646i0","output_id":"424bfc4c9f75d54do0"},{"input_id":"424bfc4c8189a646i1","output_id":"424bfc4c9f75d54do0"},{"input_id":"424bfc4ce0b5bd48i1","output_id":"424bfc4c2bb36345o0"},{"input_id":"424bfc4ce0b5bd48i2","output_id":"424bfc4c2bb36345o0"},{"input_id":"424bfc4c41ec7e49i1","output_id":"424bfc4c2bb36345o0"},{"input_id":"424bfc4c41ec7e49i2","output_id":"424bfc4c2bb36345o0"},{"input_id":"424bfc4ce0b5bd48i0","output_id":"424bfc4c8189a646o0"},{"input_id":"424bfc4c41ec7e49i0","output_id":"424bfc4c8189a646o0"}]}}}

JR01’s angle to speed bundle, input the angle and the speed you want the enemy to be going, then it will output the appropriate XY velocity.

ok guys im kinda abondaning this project for right now because the enemy ai is a little too complicated for me rn

1 Like

ill come back later tho to this