Constraining 'Hit Boxes' to a rotating actor

T.CizzleT.Cizzle Member, PRO Posts: 3

I have a situation where I need 3 'Hit Box' actors to constrain their positions to another actor that both moves and rotates.

Everything works great until the main actor rotates and the hit boxes 'pull away' from their desired positions.
Looks like they are all rotating on their own pivot points which alters their positions as the actor both moves and rotates.

I've tried a couple examples that move the pivot point of the hit boxes, which works for their rotation but doesn't account for their constrained positions as the main actor moves. I've found a couple work-arounds that readjust their positions as the main actor rotates by adding/subtracting from their current locations based on rotation numbers, but it's not ideal at all and there should be an easier way to constrain their positions to an object that both moves and rotates. GameSalad has a great community, hope someone can help.

Best Answer

Answers

  • T.CizzleT.Cizzle Member, PRO Posts: 3

    Nice One Socks!

    This one pretty much nails it. Working nicely first try.
    Pretty clean and straightforward code too. Very awesome.

  • SocksSocks London, UK.Member Posts: 12,822

    @TCizzle said:
    Nice One Socks!

    This one pretty much nails it. Working nicely first try.
    Pretty clean and straightforward code too. Very awesome.

    Glad you found it useful :)

Sign In or Register to comment.