Announcement

Collapse
No announcement yet.

Does Overlapping Event run on a Tick ?

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

    Does Overlapping Event run on a Tick ?

    Are these the same? (setup in image)

    Say I have a cube with 6 sphere collisions on each face. Is creating 6 OnComponentBeginOverlap Event better/faster/more performant than using a tick to get overlapping components.

    If I have 6 OnComponentBeginOverlap, is this the same as having 6 Ticks ?
    If I set Collision to NoCollision on the Sphere Collision, Does it turn off the Sphere Collision, or is the Sphere Collision still checking ? (How do I disable a Sphere Collision on 3 faces for a time so that it is completely dead- as if i never had it in the scene)

    Last edited by NfrancisJ; 07-29-2019, 05:09 PM.

    #2
    Hey there!

    Event tick is called every second, whereas OnComponentBeginOverlap will only be called when something overlaps that component. Generally you wouldn't want to run anything through Event Tick unless you have to.

    Simulacrum Game | Play The Alpha | Caldera Entertainment | Twitter | ArtStation

    Comment


      #3
      Thanks for your reply.

      So OverlapEvents do not check every frame to see if something has overlapped ?

      Thanks,
      Nick

      Comment


        #4
        No, they are definitely not the same.

        OnComponentBeginOverlap only gets called when another component start overlapping with your component. So only once.
        EventTick gets called every frame, so you are going to get spammed by "Hello" for each component currently overlapping your component.

        Performance-wise, they do different things so that doesn't apply.

        I'm not sure I understand your last question.

        Edit:
        Originally posted by SE_JonF View Post
        Event tick is called every second
        Every frame

        Originally posted by NfrancisJ
        So OverlapEvents do not check every frame to see if something has overlapped ?
        It gets called the moment the overlap happens. More precisely, it gets called on the next game loop tick once the collision happens.
        Last edited by ANameTooLongToFi; 07-29-2019, 05:25 PM.

        Comment


          #5
          are you 100% certain that it works like that? I'm not talking about when it gets called. I'm talking about if it checks every frame to see if it should call.
          I'm interested in the underlying function of the OverlapEvent.

          Originally posted by ANameTooLongToFi View Post
          I'm not sure I understand your last question.
          If it doesn't query every frame, then you have answered my last question. If it does query every frame, then how would I go about turning it off, and have it in the scene. I assume setting it to NoCollision is making it inactive.

          Thanks,
          Nick
          Last edited by NfrancisJ; 07-29-2019, 05:40 PM.

          Comment


            #6
            Originally posted by NfrancisJ View Post
            are you 100% certain that it works like that? I'm not talking about when it gets called. I'm talking about if it checks every frame to see if it should call.
            I'm interested in the underlying function of the OverlapEvent.



            If it doesn't query every frame, then you have answered my last question. If it does query every frame, then how would I go about turning it off, and have it in the scene. I assume setting it to NoCollision is making it inactive.

            Thanks,
            Nick
            Overlap and Collision Events are triggered by the physics engine(usually PhysX). Every tick the physics has to update, so in a sense yes, the engine checks every tick if objects overlap/collide. It's of course very optimized so don't worry about it unless you have a very high number of collision meshes in a small area.
            Last edited by TriNityGER; 07-29-2019, 06:21 PM.

            Comment


              #7
              Great! Thank you very much.

              Comment

              Working...
              X