Object drag n drop, parenting and unpareting

Here a situation , while dropping out apple object from character hand apple object is not aligning to cursor position. Giving not proper smooth drop out experience.

While almost same code logic I’m applying with cupboard rack but here drop out is smooth and perfect.

Did anyone here have implement such kind of logic situation.

It looks like the apple is still parented to some game object when you drag it? Or that there is a scale value applied?

Okay got it, I’m using scaled down character and apple object. Scale to 1 fixed this.

But in future I was thinking to add edit mode where objects scale can be adjust at runtime. What if I scale in runtime does this issue will occur at that time also.

You can probably solve this by having an unscaled root game object, and the apple as a child of the root object, and apply movement only to the root object.

Or divide the movement vector by the game object scale.

1 Like