I am trying to smoothly eject a magazine from a vr Pistol.
I created a socket on the pistol mesh where I want the magazine to exit so It looks correct and does not clip through the gun on its way out.
Upon eject I am passing that socket transform from the pistol mesh to the magazine bp and using a tilmeline to smoothly slide the magazine from its current inserted point to the exit point, But Im also trying to add a little bit of a impulse in the same direction like it was popped out with a spring.
But Im having a issue where there is a noticeable delay when the Timeline ends and I call the impulse . It Maybe a fraction of a second but I want this to look smooth. If there is a better method I could do this please advise
ps: AS the magazine is attached I have disables physics and collisions and as you can see in the BP I am re enabling them prior to impulse. being called
Turn off teleport on the SetActorTransform; when it’s false, physics velocity is updated based on the change in position. You don’t need to add impulse after this because the velocity will already match the movement and be seamless. However, if you still want to add velocity to it, enable VelChange on AddImpulse. This will change the velocity directly instead of taking into account mass, which will give you more direct control.
Thanks, That seems like a good call to try,
I think I already tried messing around with it a bit without luck but will try again.
I will have to enable physics before I do that either before the Timeline or set actor transform.
Just some extra info In case I’m setting up the timeline wrong.
The timeline float track is 0.3 in length and has 2 keyframes.
zero value @ zero time
and value 1 @ 0.3 time
Update: It wont work like that because you cant move a simulated mesh without using teleport, ERROR!
(Attempting to move a fully simulated skeletal mesh SkeletalMeshComponent0. Please use the Teleport flag)
And the mag just falls to the floor and does not move
But without physics the solution you suggested wont apply velocity either.
Is there a way I could control the impulse direction and to move in the exact direction the transform actor Is moving, that way I wouldn’t even have to use a timeline.
Don’t use a skeletal mesh for the mag; use a static mesh (which makes sense since it’s rigid). I tried my solution on a static mesh and it worked perfectly (it was seamless). The SetActorTransform node even works on a simulating mesh! So I had to make sure to stop transforming when setting the mesh to simulating.
You could try using physics constraints to have the mesh slide out when ejecting, then break the constraint after it’s out. But I don’t know how stable it would be.
Thanks Again. I was also thinking about using a constraint as most of my interaction is built on them. But I will also try the static mesh method too.
I Made a new Magazine based on a static mesh and I’m encountering the same issue again :(. I’m starting to think the timeline is the issue.
I think its when it executes the finish pin and there is a tiny delay Causing the mag to pause and hover in the air for a moment before the magazine falls or impulse is applied.
Not sure why this is happening but I have encountered ta similar issue in the past with timelines.