I have a simple FSM design. My first person character is able to move a cube when it is close to a cube. I have done this through raycasting. So whenever the first person character controller is within a certain distance from the cube the raycast hits the cube and a numer of actions are executed.
First state = setting up the raycast and tracking when it hits a specific game object. Once the raycast hits the cube it goes to state2 and it executes a number of actions.
action 1=add force
action 2=play audio source
action 3=return to state 1
The audio source clip plays whenever the ray hits and this is fine, however I noticed a delay so that the actual movement of the cube isout of sync with the audio source clip which is the sound of a moving stone. I have reversed the order of actions. So first sound and then add force but that doesn't change anything when running the game.
Wondering if anyone is able to provide help on this how to make sound and a movement of an object simultaneously.
Thanks!