Hi, I’m trying to tip an object (Coat Rack) onto the player.
I have the player transform and i was thinking that when the player enter box collision. A timeline would rotate the Coat Rack onto the player. That’s where I’m having a problem.
How to I translate the player transform to a fall down location?
Or am I doing it wrong?
Any help is appreciated, thank you. (Also yes the player is tiny)
Hi! You’re actually very close — the main issue is how you’re determining the target rotation for the coat rack so it falls toward the player.
You don’t need to “translate the player transform into a fall location.” Instead, think of this as a rotation problem, not a position problem.
Recommended Approach (Rotate Toward Player)
When the player enters the trigger box:
Get direction from Coat Rack → Player
FVector Direction = (PlayerLocation - CoatRackLocation).GetSafeNormal();
Convert that direction into a rotation
FRotator TargetRotation = Direction.Rotation();
Adjust the rotation so it tips over (not just faces the player)
You likely want to rotate around one axis (Pitch or Roll depending on orientation), not fully rotate like a turret.
You’re using “Set Transform”. You need to use “Set Rotation.”
Use the “LookAt” node to get the rotation you need, rotate on Z for direction, then rotate on Y for the “Tip”.
You can do this with multiple outputs in the timeline if you need to!
Also make sure the point you are rotating is the point on the ground closest to the player! Otherwise it’ll clip through the ground if you’re using the bottom center.
The base of the coatrack is falling in the right position now. But im now trying to slow down the fall. I mess with the time, value. Don’t know what im doing wrong.
What does the inside of the timeline look like? And you can’t change the Interp Speed? Typically you would want to use a Lerp (Rotation) instead of an RInterpTo here.
So you’re plugging the 0-1 value from the timeline into… delta time. 0 means frozen in time, 1 means 1 second=1 second. Typically, you would use this setup with a LERP (Rotation) and plug this value into the Alpha value, then the starting rotation goes in A and the Ending rotation goes in B, with the output going to a Set World Rotation node.
You need to set both values as a variable first, though, or it will CONSTANTLY update the two inputs which would make it misbehave.
Actually, I look at a timeline as like a mobile event tick. And you don’t even have to use float tracks. You just need a fast firing source for X seconds it can do it. A russian boy on Youtube figured out that you can set the length with 9 number 9s, and add a float track, two key frames, first one at time zero value zero, second one time 9 number 9s and value number 9s and out that float output comes a perfect milisecond timer.
There are set actor locations and transforms. But then there are add actor world offsets. In this case, the fast fire from your timeline could drive an add actor rotation. But I think the problem you will run into with this is the PIVOT POINT for the rack. I have done that before but I forget. There are tutorials out there for pivot point editing.
Then you will need a way to trigger it. Box collision overlaps? Proximity?
But in slowing down a new problem showed up. The coat rack circles down, or goes back a little then falls.
I messed around a little with it and discovered that when I walk out of the box collision in a direction and remove the X axis from coatrack relative rotation (point A). It falls perfectly. I don’t know why and how to do it for all direction. Just the front and back of the coatrack. Remove X axis for front, Z axis for back for perfect fall.
Only change the values of the fall that you want. Use the original values from the coat rack’s rotation (you can break the rot value into x,y, and z by right clicking and choosing “Break”) to keep the old rotation for specific parts of the rotation, location… anything you need! You could even add or subtract to the original value before setting it.