Ignoring specific physics actor collision

Hi there,

I have few characters which enter ragdoll when hit by my melee weapon. I also have vehicles which wander around. When characters enter ragdoll, they are basically physics bodies as per my knowledge and my melee weapon collision settings block those bodies which gives me a good effect of smacking them around. But I don’t want to be able to smack a car. Cars have physics enabled as default … is there a way to disable collision with car’s physics bodies for my melee weapon only ?

My weapon is jus a mesh which is attached to my hero character using socket. Has a simple box collision

M making an android game so I hope solution is not heavy

What you can try is

  1. On your cars actors begin play, call function Ignore Actor when Moving
  2. then Get Player Character
  3. Cast to your character class
  4. Get the Weapon mesh / actor
  5. Set it as a target for function in step 1
  6. Profit

Hope it helps! (mark as answer if does)

that would help me a lot but there is a trick … I don’t have the weapon attached to the actor all the time … when enemy is in range, I spawn the weapon and attach to him (as equipping mechanism) … so there is no specific reference for the actor to plug in that ignore when moving node.

Do I have to pass the reference to vehicles every time I spawn the weapon or is there any simpler way ?

Ignore Actor when Moving is not for physics body. It states in the code:

/**
	* Set of components to ignore during component sweeps in MoveComponent().
	* These components will be ignored when this component moves or updates overlaps.
	* The other components may also need to be told to do the same when they move.
	* Does not affect movement of this component when simulating physics.
	* @see IgnoreComponentWhenMoving()
	*/