hello , I have a problem with simulating physic. when my fps is above 100 the simulated object will move normaly , but when my fps is higher the simulated object will move fast or some times it does not move my point is why changing fps will affect the simulated object , how i can fix that ? thanks for answering .
Hi @meran-99
Without seeing the problem visually its hard to diagnose.
But what i will say is, if you perform actions in fast paced code (ie on tick) they will operate at the same speed ie every frame.
To delink the actions speed from the fps you need to multiply any values by deltaseconds ( or WorldDeltaSeconds when outside of on tick)
In a nutshell if you increase the velocity of an actor by x using on tick or input event. It will trigger as fast as the tick or event happens (usually every frame not always) so if you have more fps the actions happen quicker.
Let me know if this makes sense or if you can be more specific maybe show soem blueprints, if this isnt the issue
thanks for answering bro , I do not use tick event i have an actor when my player overlaped with this actor then start simulate physics i use actor begin overlap. but i added force at location when the fps changes the force change too.
so what you need to do is delink this from the fps with worlddeltaseconds
You will need to then play with the amount of force as it will now be different.
now that said are you adding force constantly whilst overlapping? or just once?
if just once there should be an issue, if constantly whilst overlapping then you will need to do this.
if you are doing it once then there maybe an issue in you code where it is repeating itself in a loop. But it definatley sounds like an fps issue if it changes based on that.
in the blueprint you want (force x deltaworldseconds) and input that into your add force.
like i said this value will now likely not be correct so play with it til you get what you need (more than likely you will have to increase the force value as you are multiplying it by a value in the region of 0.0167 or similar depending on your fps)
bro i do the things that you said but the ammount of force is changing .
what i need to to is when the player hits the tree the the tree fall in the direction of the player hits but the value of that force is changing with the fps some times are too high , somtimes are to low even they do not affect the tree , and somtimes is very good .
ok this is a 1 time event so scrap the worlddeltaseconds , also try using add impulse not add force, around 100 x vector thats how i fell mine as it gives only a simple impulse 1 time
you may need more or less depending on the mass of your tree
let me know!
dont just use 100 x and 100 y, multiply it by your vector!
bro thanks for answering i changed the force to impuls and it solved it i change the fps but the ammount of force is not changing .thank you bro for your time .
you are more than welcome, happy coding!