david.cambre Posted August 4, 2020 Share Posted August 4, 2020 Hi, when using "public BodyRigid nodename" the editor does not show the property field. ComponentClass supports Node and Unigine.Component and not Physics-Related Classes. Is there code to validate the node type? Or to get direct feedback in the editor if the selected .node is not acceptable? This is my current code, it works and keeps the program from crashing on Init. General help and advise is always welcome. public Node bouncing_node; private BodyRigid bouncing_body; private void Init() { if(bouncing_node) { if(bouncing_node.NumChildren > 0) { var child = bouncing_node.GetChild(0); if(child.ObjectBodyRigid) { bouncing_body = bouncing_node.GetChild(0).ObjectBodyRigid; } } } } private void UpdatePhysics() { if(bounce_triggerd) { bounce_triggerd = false; if (bouncing_body) { bouncing_body.AddForce(vec3.UP * bounce_power); } } } Link to comment
karpych11 Posted August 5, 2020 Share Posted August 5, 2020 Hello, At the moment there is no way to check the type of node or that is null in the editor. Now fields are automatically checked for compliance with the type when assigning a node to a component parameter. Therefore, there is only a guarantee that the field will match the type or its inherited types, or that the field will be empty. Link to comment
david.cambre Posted August 5, 2020 Author Share Posted August 5, 2020 So if it is not possible to request BodyRigid directly. Is it possible to give feedback while still in the editor? Like OnValueChange Check_value if ok return else clear value or value color red Link to comment
silent Posted August 6, 2020 Share Posted August 6, 2020 Hi David, I'm afraid right now there is no any validation algorithm available on Editor side. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts