x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Setting Rotation for an A.I

Hi, So I am currently developing an A.I guard, I have currently set up one condition using a behavior tree and a target point

Which is Move to this point (shown here)

alt text

But the problem is the AI guard walks to the location but just stares at the door (like so)

alt text

I want him to turn and face the opposite direction any ideas how I make him do a 180 ?

Product Version: Not Selected
Tags:
ai1.png (914.9 kB)
ai2.png (978.6 kB)
more ▼

asked Mar 15 '16 at 07:23 PM in Blueprint Scripting

avatar image

Jamiex304
41 23 15 21

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

You would run the task after the move to was successful or create a custom moveto and rotate task combined. To create a new task:

alt text

And its graph would roughly look like this: alt text Running it after the moveto that you already have would look like this: alt text

That should get you in the right direction.

btnewtask.png (26.0 kB)
rotatetaskgraph.png (127.9 kB)
more ▼

answered Mar 15 '16 at 09:59 PM

avatar image

Black Phoenyx
4.1k 165 9 170

avatar image Jamiex304 Mar 16 '16 at 01:19 AM

Hey thanks for your help but, one last question : how to I get reference to the target point (I cant seem to figure it out at all) ?

avatar image Black Phoenyx Mar 16 '16 at 01:21 AM

The same way the moveto is getting it, it should still be in the black board so use a get black board value as vector and grab the key name for the target points stored vector.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

After he reaches his destination you can set his rotation opposite of the guard position by using his lookat rotation to the target point and then reverse it.

more ▼

answered Mar 15 '16 at 08:06 PM

avatar image

Black Phoenyx
4.1k 165 9 170

avatar image Jamiex304 Mar 15 '16 at 08:13 PM

Anyway u can show me what that looks like ? (if u have the time)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This should do it, let me know. alt text I didn't have time to setup a target point or anything else so I used a random reachable point in radius but instead you would use the target points location and the controlled pawn is the AI pawn.

more ▼

answered Mar 15 '16 at 08:26 PM

avatar image

Black Phoenyx
4.1k 165 9 170

avatar image Jamiex304 Mar 15 '16 at 09:22 PM

see the problem is I am using move to in the behavior tree ?

avatar image Black Phoenyx Mar 15 '16 at 09:30 PM

That is a screenshot of a move to task in a behavior tree task that I setup, it should work no matter where the moveto task is whether it is run from the AI character event graph or in a BT moveto task. If you are just using the simplified MoveTo task node in the BT, then you can make a new task that will set the rotation after the move to is successful by clicking on the NewTask button at the top of the BT editor window and creating the rotate actor task.

avatar image Jamiex304 Mar 15 '16 at 09:39 PM

Here is what I have in my behavior tree alt text

Where would I set such a task and what would that task blueprint look like ?

ai3.png (56.2 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question