Announcement

Collapse
No announcement yet.

Using line trace

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using line trace

    I'm looking to implement a spell system and was thinking of using a line trace to hit my ai get it's location and spawning a projectile to that location. The issue I have with it that using a line trace I would need to use an event tick and im not sure if that's the best way to go about it any suggestions would be appreciated

    #2
    Don't you just need to ray trace on button/keyboard input?
    I'm @londonisunreal, the organiser of the London Unreal Engine Meetup group.

    Comment


      #3
      Like Jez said, you can just set it to a button input to trigger the linetrace. But if you need it to be a continuous firing, I have started setting up my linetraces like in these images. Trigger a "Set Timer by Function Name". You could just trigger this at event begin play, or trigger from a custom event like I have done. Then create a function and set up all of your linetrace in that function. Call that function name in the "Set Timer by Function Name". From there you can set it to looping, and set the time for how often it needs to loop. I found my linetrace in this instance was fine to call it every 0.1 seconds.
      Attached Files

      Comment


        #4
        Looks good it's it costly on the game though ?

        Comment


          #5
          Not as bad as event tick. Its 1/3 the cost at 30fps, and 1/10th the cost at 100fps. Unless im missing something.
          Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand

          Comment


            #6
            Originally posted by 6ixpool View Post
            Not as bad as event tick. Its 1/3 the cost at 30fps, and 1/10th the cost at 100fps. Unless im missing something.
            That's right. But it would be a rare use-case that needed more than a single line trace on event.
            I'm @londonisunreal, the organiser of the London Unreal Engine Meetup group.

            Comment

            Working...
            X