skinwalker
Member
I think I have a problem with this task in every single case scenario and more specifically with Offset's Y and Target Offset's Y, these two vectors determine if the task will work correctly or not, but they vary depending on the current NPC and target.
I can have my target be in line of sight (according to the debug drawer), but the CanSeeObject task will return failure if I dont set the correct offset's Y, so some NPC's work great with 0 then I change my target it requires both of these values to be set to 1, I just can't wrap my head around this why its needed and whats the logic behind it.
Why the CanSeeObject works normally if the NPC is a human archer, the target is player and both of the Offsets are set to 0,1,0 but then I change the target to a cube and it won't work unless I set both of them to 0,0,0 or the offset 0,1,0 and the target offset to 0,0,0, can this thing just use the same vector across ALL enemies and ALL npcs? I haven't updated BD in awhile so if something in this script has been changed I will download the new version.
Let's demonstrate it:
Offset is 0,0,0
Target Offset is 0,0,0
Put the cube in the air
As you can see the debugger draws the angle from the feet of the model (I think the pivot is actually at her stomach not feet but lets assume its right and its casting from the feet) and the cube is above the ground so it shouldn't see it right? Wrong it detects it perfectly fine
Now lets change it like this
Offset 0,1,0
Target Offset 0,1,0
And put the cube back on the ground
The yellow angle drawn by the gizmos goes right in the middle of the cube, it seems like it should work right? Well it doesn't work my NPC cannot see the cube in that case.
I can have my target be in line of sight (according to the debug drawer), but the CanSeeObject task will return failure if I dont set the correct offset's Y, so some NPC's work great with 0 then I change my target it requires both of these values to be set to 1, I just can't wrap my head around this why its needed and whats the logic behind it.
Why the CanSeeObject works normally if the NPC is a human archer, the target is player and both of the Offsets are set to 0,1,0 but then I change the target to a cube and it won't work unless I set both of them to 0,0,0 or the offset 0,1,0 and the target offset to 0,0,0, can this thing just use the same vector across ALL enemies and ALL npcs? I haven't updated BD in awhile so if something in this script has been changed I will download the new version.
Let's demonstrate it:
Offset is 0,0,0
Target Offset is 0,0,0
Put the cube in the air
As you can see the debugger draws the angle from the feet of the model (I think the pivot is actually at her stomach not feet but lets assume its right and its casting from the feet) and the cube is above the ground so it shouldn't see it right? Wrong it detects it perfectly fine
Now lets change it like this
Offset 0,1,0
Target Offset 0,1,0
And put the cube back on the ground
The yellow angle drawn by the gizmos goes right in the middle of the cube, it seems like it should work right? Well it doesn't work my NPC cannot see the cube in that case.
Last edited: