Hot answers tagged

1

The problem is that the if-statement will only be true while the object is close to the target. As soon as it moved far enough back to no longer be within 1.0 units, it returns to its old behavior of moving back to the target. What you have here is an object which can be in two different states. The "moving to target" state and the "moving to ...


1

So from what I understand, you want a behaviour where, ThrowObject is run until completion, then you wait a specified time and start ThrowBack, for this I would use a third coroutine to control the execution of the first two. So the idea being you start the Throw Coroutine, which then handles the running of the other two coroutines, with a WaitForSeconds ...


1

If you check out the documentation for Application.Quit it starts by saying this: Quits the player application. Shut down the running application. The Application.Quit call is ignored in the Editor. Application.Quit does nothing if you test inside the editor.


1

Hatoru Hansou adviced that I set velocity instead of addforce, but for various reasons involving my other locomotion requirements (wallwalking and grappeling/swinging) this is something I want to avoid because I want to use the same forces and controls during swinging and wallwalking as I do while walking (just altering speeds and gravity multipliers). So ...


1

If I interpret this example correctly, then you have a situation where you have a game object which is supposed to do "something" unless there is a reason why it can not do "something" right now, and there is a large number of potential reasons for that with different grades of obscurity which depend on various other gameObjects. In this ...


Only top voted, non community-wiki answers of a minimum length are eligible