Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - betonos

Pages: [1]
1
Support / Re: Check texture alpha at RaycastHit...
« on: September 04, 2012, 11:02:37 am »
OK, I've figured it out in the meantime (and did it the way you suggest).

The problem that I am facing now is the following:

if I don't disable alpha trimming in atlas and the sprites get trimmed the following bug occurs:
1) sprite bounds are calculated for trimmed sprite - this is OK
2) but the gameobject.transform.InverseTransformPoint transforms according to the original, untrimmed size of the object.

This problem is shown here in detai:


2
Support / Check texture alpha at RaycastHit...
« on: August 31, 2012, 10:06:14 am »
Hi,

I'm trying to pick an object pixel-perfect. But I don't want mesh colliders of any kind on the object, because I have lot of theese objects. So what I want is to do Raycast and then check texture alpha value at RaycastHit position. But the problem is, the textureCoord field has value of (0;0) no matter where the hit occurs. This is due to the fact that the object has no mesh collider (according to Unity documentation).

How do I calculate UV values for the atlas texture and get the correct pixel alpha value at the hit position?

Pages: [1]