Skip to content

Problem with setScale() and collider detection #2028

@SteveGreatApe

Description

@SteveGreatApe

I've got an object in my scene where I control it's size using setScale. I've also got a Collider on this object. I've found I'm having problems getting the pickers nearest object detection to work when this object is in front of another object with a Collider.

What I think is happening is that the calculated distance used to determine the nearest object is also getting mapped by the scale. So for instance if an object is 2 units away, and has a scale of 0.5, then the distance gets divided by 0.5 giving a total of 4, which is the effective distance allowing for scaling.

So if there's another object 3 units away with a normal scale of 1, this gets given a distance of 3 so the Picker thinks it's nearer and returns a hit on this object, not the scaled object that is actually closer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions