Orbit Controls with constraint set to "lock" prevents panning feature

Version 3.25 has the improvements mentioned above :slightly_smiling_face:

You can also now update view positions from e.g. UnityEvents. So you can for example add a button to some object and then call one of those methos from the button to update the campos + looktarget without writing code

public void SetCameraAndLookTarget(Transform obj) {}
public void SetCameraTargetPosition(Transform obj) {}
public void SetLookTargetPosition(Transform obj) {}

Works much better now. Cool!
Also that we now can also send the object and not only vector. I also tried to subscribe to the “CameraTargetReachedEvent” and looked in the docs, how to do it.

`onEnable() {
this.orbitControls = GameObject.findObjectOfType(OrbitControls);
this.orbitControls.CameraTargetReachedEvent.addEventListener(this.onTarget);
}

private onTarget = () => {
console.log (“arrived”);
}`

this should do it, but I get an error: Cannot read properties of undefined (reading ‘addEventListener’)
Surely it’s another “simple” thing, but I’ve no clue.

by user 539536674582036491

also very handy!

by user 539536674582036491

this.orbitControls.addEventListener(OrbitControlsEventsType.CameraTargetReached, (evt : CameraTargetReachedEvent) => { ... });
or
this.orbitControls.addEventListener("target-reached", (evt : CameraTargetReachedEvent) => { ... });

Thank you! Second one works for me. Even if I have no idea, why these other elements are needed - good to have an example.

by user 539536674582036491

The reason is that this.orbitControls.CameraTargetReachedEvent is not a member on the OrbitControls but the type of the event that you get in the callback.

It could be a Unity Event (what we call EventList) maybe to make it more explicit/easy to assign from the Editor, you’re right.

yes, might be easier. I updated my demo site and I’m pretty happy with the current flow from one view to another. Thank you for taking care. This question is now more than answered :slightly_smiling_face:

If I find more time to work on it I’ll test some other features and hopefully there will be a paid case sometime.

The last pitch (which was also the first try on a interactive web app) we were too expensive, but they also compared it internationally and compared to people from way far east we could not compete :face_with_diagonal_mouth:

by user 539536674582036491

Happy to hear the changes are useful to you.

The last pitch is the one you made and shared above or was that something else / unrelated to Needle Engine?

Yep, it was around the 10th that we had a meeting with a potential customer and the topic was an interactive web app and I planed to use needle.

by user 539536674582036491

But it was also that you were still familiarizing yourself with the engine and tools at the same time right?

Not sure if I understand you correct, but yes, I was confident enough to get it done in needle (even I’m not experienced enough), because we would have had enough time for it and since the pro plan has also support (without feeling guilty) the rest problems seem solvable…

by user 539536674582036491

I see, thats good to hear. I hope it works out next time!