Ambiera Forum

Discussions, Help and Support.

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

Robo
Guest
Quote
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);

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


Robo
Guest
Quote
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...


guest
Guest
Quote
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)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






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