Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, Using the raycast, is there anyway to get the ray hit object by script? And, how do I join the last path node? Thank you |
||||
|
Yes, you can use ccbDoesLineCollideWithBoundingBoxOfSceneNode() and ccbGetCollisionPointOfWorldWithLine(), those are exactly for this. But I'm not sure what you meant by joining the last path node? |
||||
|
Seems like only ccbDoesLineCollideWithBoundingBoxOfSceneNode() returns the collision scene node. But the problem with this function is it will check the bounding box for collision, not the mesh node. I mean, if I cast a ray towards an enemy like fps shooting, it will hit the enemy even if ray is outside the actual shape of the node. See the attached image. The red dots are rayhit position. Sorry for the confusion, I mean when we add the path node, the last and first node is not attached. I could not find out how to attach that nodes, so that Ai can walk in a loop. |
||||
|
In attributes menu of path... There is an item specific option "is closed circle" tick that option and then ur path's last node will be joint to first node.... |
||||
|
Oops, didn't thought about checking the attribute tab. Thank you. |
||||
|
Currently only bounding box tests are supported there. For static world geometry, you can check against the world instead with that other function. |
|