I have a lever that i use ray casting to detect, so when player is looking at the lever, they are able to activate it. However i ran into a problem, which is that parts of the lever, specifically the handle and gears, don’t have visibility collision, therefore are not detected by ray cast, which goes right through them, so it doesn’t get the lever class from actor, so I’m not able to activate the lever when looking at handle, which, you know, would be not good for the player.
Both handle and gears are part of skeletal mesh, which contains the animation. When using regular static meshes for those parts, they have visibility collision and are detected as part of the lever class actor. But they are, well, static, and i don’t know the way to animate them with skeletal mesh animation, so it seems more simple(?) to me to somehow add visibility collision to the skeletal mesh, but i don’t know how. Any pointers or advice on how i should do that?
Having done this a lot, I wouldn’t bother with the collision settings of the components at all
Having things in a blueprint helps immensely, and then including a shape ( typically a sphere collision ) set to block all as the ‘grabbable’ aspect of the control is the best way.
Otherwise, it can be very fiddly for the player to get a line trace to land exactly on a lever like that. You really want the player to be able to easily grab the lever, and so a ‘generous’ shape surrounding the end of the lever is better.
Hey, that’s a good advice! Just tried to add a capsule collision only for that purpose and it works just as i needed it to, and also allows room for error when targeting the object, just like you said! Thank you very much!