Fix for null parent
This commit is contained in:
parent
f940e8566e
commit
13c1e0508d
|
@ -17,7 +17,7 @@ class GetLocationNode extends LogicNode {
|
|||
|
||||
var loc = object.transform.world.getLoc();
|
||||
|
||||
if (relative) {
|
||||
if (relative && object.parent != null) {
|
||||
loc.sub(object.parent.transform.world.getLoc()); // Add parent location influence
|
||||
|
||||
// Convert vec to parent local space
|
||||
|
|
|
@ -6,8 +6,6 @@ import armory.trait.physics.RigidBody;
|
|||
|
||||
class SetLocationNode extends LogicNode {
|
||||
|
||||
var quat = new Quat();
|
||||
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
@ -19,7 +17,7 @@ class SetLocationNode extends LogicNode {
|
|||
|
||||
if (object == null || vec == null) return;
|
||||
|
||||
if (!relative) {
|
||||
if (!relative && object.parent != null) {
|
||||
vec.sub(object.parent.transform.world.getLoc()); // Remove parent location influence
|
||||
|
||||
// Convert vec to parent local space
|
||||
|
|
Loading…
Reference in a new issue