简体   繁体   中英

How to use attach actor to component

I'm trying to make a hockey game in Unreal engine and trying to make a way for the puck to attach to the players stick when the stick enters the pucks HitBox. This is what I've tried but it is not working at all, (This blueprint is in the pucks event graph) pls help, new to ue4

It looks like you're testing the overlap against the ThirdPersonCharacter 's collision mesh, which is just a capsule shape centred on the actor. In your BP, the OnComponentBeginOverlap event will only fire with OtherActor returning the character if the puck overlaps that capsule object. It would seem likely to me that the hockey puck never touches it, especially if the puck is sliding around on the floor.

You need to test against the hockey stick's own collision, for which you need to use the OverlappedComponent value and cast to the hockey stick class to test that it's a hockey stick. Or you need a separate collision mesh at the end of the hockey stick.

I don't know how your ThirdPersonCharacter is constructed so it's difficult to say.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM