F.hao 16 Posted July 7, 2022 Like this, if the Raycast Line start mushroom's postion, to the direction(0,0,1), then there is nothing can be hit. So does this is a bug? Or maybe i want know why? Share this post Link to post Share on other sites
Igor Q. 519 Posted July 8, 2022 (edited) @F.hao Hey 1) Have you checked to make sure collision is on for all objects? 2) Have you checked the distance of the raycast? If your raycast distance is too far it will not work. 3) Raycast inside (or beside an object) might cause it to immediately "hit"? Have you tried using a console text that prints the hit position? Edited July 11, 2022 by Igor Q. Share this post Link to post Share on other sites
F.hao 16 Posted July 10, 2022 On 7/8/2022 at 9:37 AM, Igor Q. said: @F.hao Hey 1) Have you checked to make sure collision is on for all objects?------Yes, Collision is enabled. 2) Have you checked the distance of the raycast? If your raycast distance is too far it will not work.---------I have test different distance, and i didn't find raycast to be invalid.so i think the length is not a problem. 3) Raycast inside (or beside an object) might cause it to immediately "hit"? Have you tried using a console text that printa the hit position?-----Yes i always text with console. And my ways is use a Entity's postion & axis_Z direction to fire a raycast. But once put the entity into another object, the raycast will Hi Igor.Q Sorry for so late to reply. I test again and here is my .yland. The answer is same, if you can check it. RAYCASTSHOT.zip Share this post Link to post Share on other sites
Mello1223 591 Posted July 10, 2022 (edited) for me,it works good. entity 1 = mushroom position Y 0.375 entity 2= mushroom position Y 0.255 everytime hit correct target ,collisions ON Edited July 10, 2022 by Mello1223 Share this post Link to post Share on other sites
F.hao 16 Posted July 11, 2022 6 hours ago, Mello1223 said: for me,it works good. ...... Oh,Yes, for now i think raycast is work good. I think i make a misunderstanding. The point is: if the Begin position in another Object's body, then the raycast will ignore Object-self and keep going forward (before our test, i just thought it will hit Object-self). and @Igor Q. Everything is clear now. By the way ,i found this problem because i'm trying make a function to let my AI-bot move in the ground, and there is some Entity to block road. The origin idea is just found a position by raycast, and AI can go to the position. But then i found if my AI walk into the Entity, caused by some rotate event, like if AI near the wall,and suddenly rotate, then it will enter the wall, and once they already be in the wall, the raycast will not use. It will never help me found a right position to go. And yes, i know this is not a Complete function, So at last, i choose bfs to find a road.😆 1 Share this post Link to post Share on other sites
Houp 237 Posted July 11, 2022 Hi, colliders on objects have just one side active. In most cases it is enough and you can have half of active "colliders". If you want to hit also object itself than I would suggest to use Overlap sphere script tile with really small radius. 1 Share this post Link to post Share on other sites