Since armory fails compiling for me at the moment (seems like the Kha API changed…), I cannot validate this setup, but this is what I would’ve done. Although it looks just like what you have described about your setup… Maybe, just maybe, there is an issue when not using the x axis as facing, but I really doubt it. I will look into it, once I can compile again.
@ zaethan
Is it possible to get an object to move in the direction that it is facing? The Translate on Local Axis node doesn’t seem to be working and Translate object only moves in specific set directions.
Front facing axis and Main rotation axis does not have default values
Setup the axis values , the look at logic node works as expected.
Would it be good to add rotation speed option to the node or make a new node with speed parameter ?
For example some device turning to the player with a constant slow speed, the player can avoid it’s ranged attacks by moving faster.
Yeah, I wasn’t sure about whether I can set default values for vectors in python, so I skipped that. Maybe I should’nt have done that, sorry for wasting your time because of this… But hey, at least it’s working now
As for rotation speed, I don’t think this node is the right place for this. Above, you already mentioned that it has many parameters, and adding speed options would make the node even more complex… I think it would be better to use another node to interpolate between the current rotation of the object and the desired rotation (which could be given by the looking at node). This approach would also add the benefit of being independent of the looking at node for speed based rotation.
Translate on Local Axis does not work? It would be the first one I would’ve recommended in this case. You could try using the vector from transform node then.
Like so:
This should do it… Just don’t forget to select the object you want to move in the object node (and also don’t forget to add your nodetree as a trait to an object in the scene).
Does it make sense to everybody that the built-in Look At node should output Euler angles as there is no way to work with the Quat that it outputs ( with built-in nodes, anyway ) and because all of the other nodes use Euler rotation? I want to submit a PR to fix that if everybody thinks that it makes sense.
The LookAt node is exactly what I need for something I’m doing, but I can’t use its output at all with the existing nodes. I could install the logic pack, but I don’t think you should need to in this instance.
I really don’t know any other node that uses quaternions (aside from the QuatToEuler node in the logic pack), so I guess it makes sense to remove the quat output for now.
(Another idea would be to add quats to all other nodes that deal with rotation (and maybe remove euler vectors) to strictly distinguish between rotation and non-rotation input/outputs).
I’m trying to create the same effect but @zaethan node setup doesn’t work for me. I have a plane in the scene (button 1) and I want it to be facing the camera at all times. The plane is parented to the cube in the center, which is able to be rotated using the mouse (turntable). As you can see in the example attached, when I rotate the cube, the plane rotates with it. How do I make the plane face the camera the entire time?
If it helps to know the goal, I will be parenting the plane (button 1) to the end of the cylinder coming out of the cube. As I rotate the cube, i want the plane to be stuck to the end of the cylinder while maintaining its rotation and facing the camera at all times.
I tried both but no luck so far. Cylindrical works well if the plane is stationary. However, as soon as I parent it to the cube it starts rotating with the parent. The scale of the plane becomes distorted also.