Location question

I know its pretty easy but i can’t seem to undestand…

If i have a object i want to move and i apply the location to where the mouse position is in world space, how would i go about that but also keep its original distance from object to mouse position?

Keep in mind, it always set the value of mouse position duo to it moves, that where the distance part is importan

If it moves to where the mouse is, then surely the distance is zero?

I want to keep its distance at start, like if i were to drag it like a gizmo

Hmm, there’s a lot of different ways of doing that kind of thing.

Do you mean a runtime gizmo, just like the editor one?

Well yep, but im not trying to make a gizmo system

What i am looking for is how i would go about moving an object along with my mouse but keep the distance from my clicked mouse position and object
Remeber that the mouse is moving

Meh, you might be able to do something with the mouse cursor and

image

But it’s not clear how that should work. Firstly because you can’t click on the object in the first place.

Getting an object to follow the camera would make more sense. ( gimme 5 )

Like this

move

Not quite, but i think i might find what i am looking for. Something to do with inverse transform, just dont know a thing about it haha.
I’ll do some research on it, but if you have some information on it i would appricate to hear it :slight_smile:

fp level

:smiley:

1 Like

Inverse transform is when you’re converting from local space to world space, or the other way around. You’re not.

If you’re using the mouse cursor, you’re converting from screen space to world space and back. Good luck… :wink:

( If you’re doing that, you can’t tell the cube to do the thing from my first picture. How can you say, ‘move around me’? You can only point at stuff on the screen.