eminem100 Guest |
Quote
|
2017-06-29 17:43:22 |
|
How to use the function ccbGetCollisionPointOfWorldWithLine(startX, startY, startZ, endX, endY, endZ) and to check if there is collision or not. The manual says it will return null. I don't understand this.
|
niko Moderator |
Quote
|
2017-06-30 08:23:57 |
|
It will return an object (not null) if it finds a collision. The object is the point where the collision is. If it returns no object (=null), then no collision was found.
You can use it like this:
var collisionPoint = ccbGetCollisionPointOfWorldWithLine(...); if (collisionPoint != null) { // this code inside here only gets run if there was a collision }
|