Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I just spent the last 3 days trying to work out why my distance checks fail to be consistent and change according to what angle you approach the child node item. The problem was the parent folder being a child itself under a 3D mesh which had a scale adjustment applied outside 1,1,1. Never do that !! - will stuff up the game and make you think the engine is broken. Unchild the parent folder from the 3D mesh and put in the main section by itself. The javascript for distance checks are these: var posdelta = this.LastPosition.substract(currentPos); var dist = Math.sqrt(posdelta.x * posdelta.x + posdelta.z * posdelta.z); or var posdelta = this.LastPosition.substract(currentPos); var dist = posdelta.getLength(); (they both do exactly the same thing). Hope this help someone one-day....driving me crazy these weird bugs... |
||||
|
Furthermore, if you want a house, ship with both inside and out - ie 2 sets of mesh with normals reversed - DONT child node on to the other as will stuff up walking collision with the player falling through the floor etc with no real solution. Just don't child node anything unless to a folder as parent of the child or in rare cases like needing to rotate lids/doors etc... |
||||
|
this should be in the manual happens all the time |
|