I am making a game using unity and I have a simulink model that recieves cooridinates and sends data from which the unity "player" moves. and as figures this needs simulink to be very quick in simulating the model and giving the output so that it can nearly sync with unity.. but the problem is simulink simulation is slow..
I update parameters using set_param then use sim function to run the simulation with the new parameters but each time takes around 2.5 3 secs which causes a response delay to unity thus incorrect/delayed motion in unity.
I tried using model reference and running the model in accelerator mode which seemed to cause the same issue..
so is there any possible way to eliminate this delay.. it should be atleast less than a second to make the motion the least good.
here's the part responsible in my matlab code: