Using Custom or Shrink Wrapped Sprite Collision
Hi there . I’m a professional game developer working on an indie title that is a hybrid 2d/3d game with a perspective camera that is locked to a horizontal plane. I’m using Paper2D for my characters and I’m having trouble getting per sprite custom collision to work. It would be really nice actually if were documented somewhere. docs cover creating collision in editor nicely but nowhere is it explained how to get it working in game on a character. I’m pretty much working entirely in C++ here.
Now digging through these threads I’ve found a couple clues. My character class is based on 2d side scroller template so it inherits a PaperCharacter class. I’m thinking is part of my problem as I found a comment in thread that says you can’t use individual frame Collison on characters with Movement Components. All I want to do is retain capsule Collison for moving character in world as is but be able to get overlap events for collisions with per frame custom colliison with certain objects (melee weapons actually ). I found your comment about calling GetSprite()->GetBodySetup () to access custom sprite Collison and that is returning my custom collision in debugger, but its not in a form i can use yet, how do I turn a UBodySetup into something useful? All of explicit Overlap test functions take a PrimitiveComponent and I can’t see an interface to create one of those per frame frome each sprites body setup. I only have 2 characters on screen at a time so I’m not concerned about expense of physics state changing for every frame of animation. In fact I will probably end up using shrink wrapped option for all my sprites. I get how to setup filters and overlap events but I’m finding path to actually getting per sprite collision working on a character in game to be pretty unclear. I’m hoping there’s a way to do without manually testing each pair of colliders. Thanks for your time.