Game Development Community

Scripting and Behaviors

by Lars-Ole · in Technical Issues · 07/22/2009 (1:10 pm) · 0 replies

Hi everyone,
I just registered to this Forums because I've discovered an issue
during the Fish Demo Tutorial.
I'm using the trial Version of the TGB.

So, during the tutorial I made a Fish move on the x-axis,
with a velocity of 20.

I wanted to try if a behaviour ("mouse flee") would work while the Fish is moving.
So I added the "mouse flee" behaviour to the fish. When I tested the program, the fish stopped moving on the x-axis (but the script for the movement was still in the game.cs). It moved away from the cursor but after that it stood still. I removed the behaviour, but the fish still doesn't want to move anymore.

I had to create a new fish to get it moving again.

So my questions are:
Is it possible to create a function in the game.cs (or elsewhere) that is linked to the fishs movement AND at the same time, give the fish one or more behaviors ?

And:
Why did the fish didn't move after I removed the behavior from it?
Does this behavior overwrite something?

Thanks,
Lars-Ole

About the author

Recent Threads

  • Tutorial links