Profile image

Raycast in FunkyTrees

3,845 Quercon  1.6 years ago

Hello
Can we have a function that casts a ray from some place relative to the plane, and returns distance at which it hit something (preferably with an ability to prevent it from seeing our own aircraft).
It would enable masochists like me, to create terrain displays, or realistic radars to fit in our not-so-simpleplanes.

  • Log in to leave a comment
  • Profile image
    42.7k phrongus

    i no tink so

    +2 1.6 years ago
  • Profile image
    137k BaconEggs
    +2 1.6 years ago
  • Profile image
    2,903 FaLLin1

    @Quercon thank u so much sir

    +1 1.6 years ago
  • Profile image

    Hmmm maybe it make us obtain new radar making techniques

    +1 1.6 years ago
  • Profile image
    3,845 Quercon

    @FaLLin1 You first need to make a variable (lets call it extensionRate) that is set to 1, when extension button is pressed, to 0 when halt button is pressed, and to -1, when retraction button is pressed. Then you make another variable (lets call it extension), that you set to "clamp(sum(extentionRate)*extentionSpeedMultiplier, minValue, maxValue)"
    Then you open the winch's xml, find the inputs section, and use "extension" as your input

    +2 1.6 years ago
  • Profile image
    2,903 FaLLin1

    this is off topic but it have a relation with funky trees need some , currently making a hoist control with 3 buttons one for lower,one for rising and one for halt and i want to add thos inputs to the winsh input any ideas how?

    +1 1.6 years ago
  • Profile image

    @Quercon Oh yeah, it for sure could be a thing (and now that I re-read your post, you're asking for it to be added, not how to do it currently). Maybe in a future update!

    +2 1.6 years ago
  • Profile image
    3,845 Quercon

    @HuskyDynamics01 "Oh darling you have no idea whats possible"
    On the serious side though, the raycast function is quite simple thing in unity. You could have a text label covered with squares, where every square has the brightness/alpha of distance at which raycast hit something, and boom. You have yourself a terrain sonar-thingy.

    +1 1.6 years ago
  • Profile image

    ...Uhhhhhhhhhhhh

    I... don't think that's even remotely a thing that can be done with just a programming language like FT.


    It would be very neat though!

    +1 1.6 years ago
  • Profile image
    29.9k Nerfaddict

    good luck with that buddy

    +2 1.6 years ago