Shoot task?

Are you using our character controller? If so you can download the integration and use the Start Stop Use task.

If you are not using our controller you'll either to create a new task or use something like Playmaker. In the Playmaker integration scene there is a shooting example.
 
Hey Justin.
Yes i use the controller but only on my player.
I am asking for my simple AI which i have created all the animations for, if i want him to shoot at me (player) can this be done with behavior designer or do i need to code a shoot when in range?
Thank you..
 
You'll need to create a new task or use the Playmaker/Bolt integration for that situation.
 
So you mean in a new task i hook up my own code?
Yes, similar to this:


What does the shoot and scooutl do in the tactical pack?
It will use an interface to perform the shooting. It contains an example interface that instantiates a prefab bullet but is an extremely simple example.
 
Thank you Justin.
If I want to create a shoot, I guess that’s an action so I tried adding the action method. But when I try to write Instantiate it does not exists,

How to simply insert my already code into methods that works/talks with BD?
 
Instantiate exists on the GameObject class so you can use that to instantiate new objects. This is more of an intro C# question so if you are new to scripting I recommend first going through a few of the Unity Learn tutorials. Behavior Designer tasks are very similar to MonoBehaviours so the knowledge is directly transferable.
 
Hmm.. Not exactly what i was looking for, I mean i have written many shooting scripts in C#,and it workd perfect, but i just need to grasp how to implement it into a BD task.

Simply put, How do i setup so using BD when player is within distance (NODE) or Cansee (NODE) then use my working shooting script? It is the using my script i am stuck at...

Please advice...
Thank you...
 
You can have a tree similar to this video:


You'd replace the seek task with your own task. Your task can call your weapon shooting script. Tasks have the gameObject and transform fields so you can call gameObject.GetComponent<> within OnAwake.
 
Hi justin
Thank you so much.
i managed to create a task and link it to a script on the object.

please take a look at my flow.

i want it to start cansee object or patrol. this works fine.
if cansee returns true it should seek and a tiner of 5 sec, when within distance it should execute the last node which is a destroy cube.
my issue is that as soon as it can see object it kills instantly. i want it to be within distance before kill it.
first sequenser has a lower priority
 

Attachments

  • deek.png
    deek.png
    33.9 KB · Views: 4
If the can see magnitude is the same as the within distance magnitude then within distance will always return success. You could add a repeater for it to keep checking within distance after can see has returned success.
 
Top