Problem with a Coin collecting Animation (fly to player + Physic)

Ok… This Question is about the following situation:

I´ve a BP Actor, that holds a StaticMesh (the Coin), and a Sphere Collider attached to the Mesh.
The Collider has no gravity and only has set OverlapAll.
The Mesh has Gravity, and a Custom Collision Preset, where it ignores everything, except for Visibility, Camera and WorldStatic.

The Idea:
Coins can drop to the floor. When the Player reaches it, the OnComponentBeginOverlap(Sphere) Event is triggered.
Now, the Tick of the BP Actor is disabled and after a DoOnce, a timeline starts to make the Coin fly to the Players Position. When it reached the target, the Players Currencies Gain a bit and the Coin BP Actor is destroyed.

This, works NEARLY like a charm…

The Problem is:
When i enable SimulatePhysics on the Mesh, it drops… the Sphere attached tro it, drops, too.
Like i wanted…

But… now the Coin won´t fly to the player when collected… it just… disappears and the Player Money gains…
When i disable the Physics Simulation… everything works again…

So… i want Physics enabled… Now i tried to disable it via the SetSimulatePhysics node and set it to false…
… No fly-2-Player…

This is the Overlap Event:


On the Screen, the Physic Nodes are disconnected… tried it connected, too…

So… Count it up…
I want:

  1. Coin should drop on Spawn with Gravity
  2. Player should activate the Overlap Event
  3. Coin should fly to the Player (or (later) any target actor)
  4. Coin should be destroyed, after timeline finishes.

Any idea what else i can do?

SetSimulatePhysics to false before starting the timeline should work, but you should move the coin mesh, not the entire actor. When you have physics enabled, the coin mesh is not attached to the origin, that’s why when you move the actor, the coin component doesn’t move. If you only move the coin instead be calling SetWorldLocation on it, it should be fine.

2 Likes

Thank you very much Tuerer.
Totally Overlooked the SimulatePhysics Tooltip :+1: