#i dont know how to explain it but it is

1 messages · Page 1 of 1 (latest)

paper gorge
#

.

#

so you want to do aim assist

mint elk
#

yes

paper gorge
#

the aim assist will make you shoot at the closest object that's within 10 degrees of your original aim vector

mint elk
#

yes

paper gorge
#

do you have a list of all possible targets?

mint elk
paper gorge
#

is this 2D or 3D?

mint elk
#

2D

paper gorge
#

one option would be to just get a list of all of the targets, and then compute the angle to each one

#

it doesn't feel very good, since you aren't using the physics system to find the targets you might be able to hit

#

you could also do a circle cast to find all enemies near where you aimed

mint elk
#

yes which is why i am stumped ... i was hoping there was like a vision raycast but there isn't so i am looking for a function or a way to get me to make this work

paper gorge
#

this wouldn't be a 10 degree cone, though

#

further-away enemies would have to be at a smaller angle to be noticed

#

Which is pretty reasonable, IMO.

mint elk
#

i think i have found a way

#

making an overlap box.. and extend it for the range i want

paper gorge
#

That'd be similar to a circle cast.

mint elk
#

i can pre calculate which objects should be prioritized

paper gorge
#

You just need to get a list of candidates

#

Then, for each one, compute a vector to it

#

then find the angle between it and the aim vector

#

I did something very similar for a lock-on mechanic. let me find that code.

mint elk
paper gorge
#

sure, so you get it when you need it

mint elk
#

i think i will be able to make it work now

#

thank you a lot 😄

paper gorge
#

here's what I did

#

I grabbed all nearby enemies, then gave them scores based on how close they were and how close they were to the look vector

#

it also reduced the priority of enemies that were dead or downed

#

and np! good luck (:

mint elk
#

oh

#

what you did was to get them through the sphere ... that works too... you can just pick from them the one(s) closest to the raycast

#

SMART