Try with hit.attachedRigidbody, it worked for me. Also a little mistake. You're calling getComponent twice in same loop…

Forum Archive Try with hit.attachedRigidbody, it worked for me. Also a little mistake. You're calling getComponent twice in same loop…

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4793
    jankovalsky
    Participant

      Try with hit.attachedRigidbody, it worked for me.

      Also a little mistake. You’re calling getComponent twice in same loop, so would be nicer to assain it to a variable

      #23093
      Jonathan Gonzalez
      Participant

        I agree, I typically use attachedRigidbody within this type of loop.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The topic ‘Try with hit.attachedRigidbody, it worked for me. Also a little mistake. You're calling getComponent twice in same loop…’ is closed to new replies.