08-03-2021, 08:24 AM
(This post was last modified: 08-03-2021, 08:25 AM by josemendez.)
(06-03-2021, 09:51 PM)JskT01 Wrote: I already checked and fixed update is only called once, I think it happens because it is called by all the particles that make up my fluid even though it is not performing a function when it collides with the container it is detecting it and it is what generates the lowering of frames, is there a way that it doesn't detect collisions with the container? I need it to collide but the event is not fired with the container
The code, as it is written, should iterate through all particles once. As soon as it finds a collider that's not named "Piso", it will unsubscribe from the collision event and the script will do nothing from that point on.
Iterating trough all particles once is of course not enough to bring fps from 50 to 17, that's around 38 ms/frame which is a lot of time. If FixedUpdate() is only called once, then what's taking up all that time in the profiler? Did you see anything unusual in the profiler?