Hi! I’m trying to modify some of the values in the .ts and .js scripts, so that the Orbit Controls work like the Map Controls example (three.js examples), which is basically just that, a modified Orbit Controls script (three.js/examples/misc_controls_map.html at master · mrdoob/three.js · GitHub). However, the values are not applying when I test the scene, since the CS component keeps its original default values instead of the new ones and there are some variables that I need to modify that are not available in the component, but I’m not allowed to modify the component’s script itself to add them. Any tips?
Hello, there are a few ways to do that with different pros and cons.
one way to go about it would be to just copy the script/component and create your own version based on that.
Another one would be by adding a new c# script and implement AdditionalComonentData - with that you can inject new settings in OrbitControls on Export. In the typescript side you can replace or wrap the methods you want to change (or use the @prefix decorator attribute but thats a bit experimental at this point and undocumented)
And thanks to @ROBYER1 for your Script because the original OrbitControl on Needle can’t disable Rotation.
But I need the OrbitControl to use the LookAtConstraint so it better like it
But what is the “Look at constraint 01” with the float number ?
Hi all… sorry to bother you with such a basic query but I’m very inexperienced with Unity and I’m hoping you can steer me in the right direction.
The above solutions seem to be exactly what I’m looking for (at least I’m pretty certain they are) but despite spending a couple of days trying to ascertain what I might need to do with them I’ve still no idea how to implement either of the brilliant scripts that you ( @ROBYER1 and @AeistDesmos ) have so kindly provided.
I’m very happy to learn, so any kind of pointers (a screenshot… or anything like that… indicating where I might need to put stuff) would be very gratefully received… and feverishly studied … at this end.
I hope you or someone can help… but I’ll totally understand if there isn’t time to do so if this is too much of a newbie question
Hey @frannie sorry for the late reply. You should be able to just copy paste the scripts from above in a new typescript file in src/scripts for example, a unity component should automatically generate which you can then add to your camera in unity (you might to need restart the server if its running)
The good news: the ObitControlsEpm.ts is absolutely perfect for what I was hoping to achieve and I can run things exactly as expected locally.
The bad news: I don’t seem to be able to compile the script when it comes to building a production version of the project.
Sadly no luck. Now when I run ‘Needle Engine > Export and Build Dist (Production)’ I no longer get the ‘failed to compile script’ notification, but the resultant build just displays the loading bar followed by an empty black screen.