trainux Posted April 17, 2018 Share Posted April 17, 2018 I am in an area cutting trees, but in a moment the camera is left in a direction where there are no trees, then it remains without doing anything. The tree I have declared it in the following way: final RS2Object tree = objects.closest ("Tree"); And to move the camera try the following: Camera camera = new Camera (); camera.toEntity (tree); Link to comment Share on other sites More sharing options...
Alek Posted April 17, 2018 Share Posted April 17, 2018 Few things. 1. If you plan on using .interact, such as tree.interact("Chop"), do NOT use camera.toEntity. InteractionEvent in OSBot will handle this for you, and theres a few additional checks it will perform. 2. You're setting the tree to final and getting the closest tree. What happens when that tree is cut down and a new tree appears? This is no longer the same tree than what we started with. Edit: Moved to Scripting Help. This was under Unofficial Scripts & Applications which this is not. 1 Link to comment Share on other sites More sharing options...
trainux Posted April 17, 2018 Author Share Posted April 17, 2018 33 minutes ago, Alek said: Few things. 1. If you plan on using .interact, such as tree.interact("Chop"), do NOT use camera.toEntity. InteractionEvent in OSBot will handle this for you, and theres a few additional checks it will perform. 2. You're setting the tree to final and getting the closest tree. What happens when that tree is cut down and a new tree appears? This is no longer the same tree than what we started with. Edit: Moved to Scripting Help. This was under Unofficial Scripts & Applications which this is not. Thanks, solved. 1 Link to comment Share on other sites More sharing options...