playMaker

Author Topic: help with projectors  (Read 2300 times)

cel

  • Full Member
  • ***
  • Posts: 132
help with projectors
« on: July 23, 2017, 04:19:09 PM »
hi guys,

I have a projector line that I want it to behave like a laser sight that follows the contours of the terrain, the laser x is supposed to be adjusted (I.e the texture scaled on the x), I've read that the shader for the projector has to allow this and that there is one (flashlight) in the standard assets. I have tried with the set property but can't get it to work.

Basically I want to scale up and down the projector on the x axis.

Any help appreciated

Thanks in advance

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: help with projectors
« Reply #1 on: July 24, 2017, 03:42:33 AM »
Hi,
I can't find the flaslight (unity 5.6 and 2017)
but maybe you can use a Line Renderer?
And with a raycast you can get the distance.

This video can help :


on the Ecosystem you can find the 'Draw Line' actions and you can find many other 'Line Renderer' actions there.



tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: help with projectors
« Reply #2 on: July 24, 2017, 05:06:09 AM »
I am using this asset here (sorry paid) that comes with a modified projector.

https://www.assetstore.unity3d.com/en/#!/content/57567

I am not using it as gun target, but it could probably be changed to that without too much of a problem.

(Are you talking about the lazer hit point, or the lazer line on the screen??)

cel

  • Full Member
  • ***
  • Posts: 132
Re: help with projectors
« Reply #3 on: July 24, 2017, 06:14:42 AM »
@djaydino - I have the laser setup, what I wanted was for the laser to follow the contour of the terrain/ramps, as is if it hits a hill/ramp it just stops at the hit point, so basically have a line that follows the y coordinate of the terrain... projectors seem to be the answer but I changing the xscale of the projectors texture doesn't seem work.
@ tcmeric - looks cool, but can't find any forum posts regarding the asset or a way to get in touch with the developer

thanks

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: help with projectors
« Reply #4 on: July 24, 2017, 06:46:37 AM »
Their website is here: https://gamenative.com/
Email address: support@gamenative.com

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: help with projectors
« Reply #5 on: July 24, 2017, 07:13:31 AM »
I have a couple of custom actions for the ground target system that I wrote, such as set color, rotation, material and enable/disable rotation. If you decide to go that route, feel free to ping me here and I can send them over to you.  8)

cel

  • Full Member
  • ***
  • Posts: 132
Re: help with projectors
« Reply #6 on: July 24, 2017, 07:56:32 AM »
that's great tcmeric,

I just sent an email to the developer asking if my request is possible... I'll get back to you if needed... thank you so much for your help

Regards

cel

  • Full Member
  • ***
  • Posts: 132
Re: help with projectors
« Reply #7 on: July 24, 2017, 08:10:47 AM »
@tcmeric

Seems that the support email no longer works, just received a mailerdaemon saying that the e-mail address can't be reached

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: help with projectors
« Reply #8 on: July 24, 2017, 01:46:48 PM »
Hi,
Sorry i miss understood.
What exactly does not work?

i had no experience yet with the projector so i played around with this a bit.
in the end i found this tutorial :
http://hyunkell.com/blog/rts-style-unit-selection-in-unity-5/
and looked to the "Highlighting selected units using projectors" part
and below that i downloaded the Projector shader and the Projector alpha mask

Be sure to set Orthographic else you will start to scratch you head (like i did)

also the alpha mask image needs to be set to cookie and alpha source to 'from gray scale'

Maybe this can help you figure out what you want to do :)