Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Feature requests and bug reports
child node distances from Player

2020-06-11 13:28:37

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);

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...

2020-06-11 13:49:27

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...

2020-10-31 10:18:01

this should be in the manual

happens all the time

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "In?ernational" (you are not logged in)




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact