Hello Guest

Author Topic: Problems with lights  (Read 5556 times)

8BitGuy

  • Newbie
  • *
  • Posts: 9
    • View Profile
Problems with lights
« on: February 08, 2014, 04:36:04 pm »
Hello, I have bought 2dtoolkit a few months ago and I am amazed with this incredible toolkit.

Now, I'm having a little problem, it is the first time I use lights with 2d toolkit and it works perfectly but in one case, if the sprite rotation.y =180 the sprite inmediatly has no light, I tried all the materials 2dtoolkit include in the version 2.1 final + hotfix 1.

I'm asking if there is a way to light a sprite if its rotation.y is 180 or 0.

thanks for your support.

keep doing a good job!!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with lights
« Reply #1 on: February 08, 2014, 10:19:52 pm »
Have you turned on normals in sprite collection settings?

8BitGuy

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Problems with lights
« Reply #2 on: February 09, 2014, 02:58:04 pm »
Thanks for your reply unikron.

Yes, I have turned normals and tangents

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with lights
« Reply #3 on: February 09, 2014, 09:55:49 pm »
I'm not sure why it wouldn't work - it should just work fine. What light have you got and what position is it at? Or if you prefer, post a repro scene here.

8BitGuy

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Problems with lights
« Reply #4 on: February 10, 2014, 02:50:06 pm »
hello I tried with different lights and positions, the player position.z is 0, a spot light at position z =  -7.3 it works on the player sprite rotation.y =0 but not at player sprite rotation.y=180

player rotation.y=0


player rotation.y=180


and the same with a point light at z = -2.5




unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Problems with lights
« Reply #5 on: February 10, 2014, 03:07:00 pm »
Thanks for the pics it explains a lot, thats kinda expected behaviour as the light isn't facing the sprite. It looks like you want 2 sided sprites - in sprite collection editor, select your sprites, set Render Mesh to "Double Sided", Apply and Commit.


8BitGuy

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Problems with lights
« Reply #6 on: February 10, 2014, 03:26:34 pm »
The problem is solved, I have to change sprite by sprite to double sided as you said.

THANKS A LOT UNIKRON!!!