im animating a door that can open and close but depending on the framerate the door ends up in a different location
how to i make this work regardless of the framerate
My code
20fps
Unlocked
im animating a door that can open and close but depending on the framerate the door ends up in a different location
how to i make this work regardless of the framerate
My code
20fps
Unlocked
Timeline are exactly designed to be independent of frame rate.
However, the fact that your B value is 4 (which is very small), tells me that you’re probably using a wrong node after it.
Pls show the entire function and the curve in the timeline.
Yep, just what I thought. Use SetWorldLocation or SetRelativeLocation, and use start and end position as A and B.
AddOffset with the timeline will give you wrong results.
P.S. Although timelines are frame rate independent, they still have their own ticks, and the number of their ticks does depend on the framerate. That’s why AddOffset works in a wrong way.
Okay thanks so much
When you throw math off of a “Timeline” node I always noticed problems. Off “BeginPlay” have a variable made that you made called “Start Location” (as a vector) and also move door where you want it and note that location, make it another variable called “End Location”. Off of your “Timeline” do the lerp like you got it, but drop your get “Start location” right click your yellow dot in your start location and hit “split struct pin” and plug it into your values for lerp, you only need one. then “split struct pin” on your “Return Value” on that “Lerp” you got. Feed those three values to a “Set actor Location” Or “Set world Location” that you have also split the “struct pins” in.
Don’t do stuff like ADD MULTIPLY SUBTRACT OR ANY MATH OFF OF A TIMELINE. The reason its going off your framerate is because the whole time its doing your door, its trying to add or subtract multiple times during that timeline because its having to do math rather than just going from one point to another. So its acting more like +4+4+4+4+4 as many times as it can. Its not actually what its doing but its an easy way to explain why its having weird results OR LERP VECTORS, I was trying to help you not rewrite a bunch of code but this explanation is long AF
Oh yeah to save on some space you can have it with the finish on a switch that sets a boolean true and untrue like “Door Open” and a branch running from you Custom event that has “Door Open” as true false, and if its open your can have it “Play In Reverse” to close the door
OH OH OH AND Another Thing, you’re gonna run into problems by mashing the open button, pass a " DO ONCE" node before that branch and have it reset to open again after it completes and sets that boolean and you won’t be able to break the door by mashing the button anymore
You can also handle this by setting a bool (isMoving?). Deny event action if is true, set to false when the door state changes (opened/closed).