How can I place an agent animation over another resource agent animation in a 2D simulation?
I already moved the order in the Palette but still the seized resource gets on top of the attached agent.
In the image below, the agent is the white triangle and the seize resource is the blue truck, I need to see the triangle on top of the blue truck. The truck doesn’t has a presentation item in the Palette I don’t know why, still it appears in the simulation.
Palette vs Animation
In the 3D animation everything looks correct because I have the Z coordinate set correctly, is the 2D animation the one with the issue.
You must ensure that your truck agent animation is part of Main as well.
Likely, you will need to have them in a custom agent population and your ResourcePool needs to add new units to it (you can set this up under the "Advanced" properties of the ResourcePool).
Then you can "layer" it below your white triangle using API calls as described in the help here.
Related
I'd like to add some sort of "properties" to different areas of the level so they can affect NPC behavior.
Level layout:
level layout
What NPC behavior I want to achieve:
NPC can freely walk around Area #1
NPC isn't allowed to go to Area #4 in general but it may decide to go there in some exceptional cases
If NPC wants to interact with the player he has to go to Area #2 and check if player is in Area #3. If player is not there, NPC have to wait until player enters Area #3
I know that I can affect the path NPC chooses by using navigation modifier volumes and changing navigation cost in some areas.
But, based on goals above, I also need at least the following
I need to get random point within specific area (for goals #1 and #3)
I need to check if some actor is in specific area (for goal #3)
And I guess I don't really need "navigation cost" feature, since if I could get random point in specific area, I would be able to control where NPC goes anyway
The questions are:
What actor should I use to mark some areas as "NPC can go here if they want to walk around", "NPC can go here if they want to interact with player", etc?
If volume is the best option, what volume should I use? My concerns about Navigation Modifier volume is that I don't really need to modify navigation process by blocking it completely or adjusting its cost.
I have used the NavMeshBoundsVolume to define the area that my AI character is allowed to be in.
Then I used blackboards and set points the AI could walk around too, adding variables enabling or disabling a point. In your case you could have a variable that is true when the player is in area #3.
I've included a picture of my Behavior Tree, so that you can get an idea of the how a flow might look. This is for an "enemy," but you could simply have the AI follow the character to a specific area instead of playing the attack animation and applying damage.
Here is a really good series on AI in Unreal Engine. It's UE4 but if you are familiar with the engine you shouldn't have a problem applying it to UE5.
I've just built a model of an airport. I've created an agent called 'airplane' and, when it moves along the path, in the 2D visualization I see the path figure over the airplane figure (instead the 3D is okay). Can anyone help me?
The Z-order in the 2D visualization is not in connection with the Z-values set for 3D animation. If the airplane agent population lives in the main agent, then you can see the agent presentation in the origin. I assume the paths are simply created in Main. Drag the airplane presentation on a path and use 'Bring forward' or 'Bring to front' actions until you see the airplane above the path, then move it back to the origin.
I'm not sure how/if this could be solved without having a custom population in Main.
I currently use Nav Mesh Agent for normal driving. What we want is for the body to remain stationary and move along its path. As pictured.enter image description here
I'd like to show congestion areas on a conveyor network by using the density map included into the Material Handling Library, but so far I haven't find a way to do so, as material agents movement cannot be tracked by the density map, but it only accepts transporters or pedestrians (both in free space movement mode).
So I thought I could create a "parallel" agent (for instance, a pedestrian) that could get attached to my material and move along with it. Then I could set the pedestrian visible property to "no" so that it does not show in the animation, or make it really small as an alternative approach.
The problem when doing the pickup/dropoff logic is that the pedestrian disappears from the scene when it gets picked up (although it's internally batched with the material) so the density map shows nothing.
Same thing happens if I try to seize/release a transporter, as they do not travel along the conveyor with the material agent.
Any idea on how to get this?
Thanks a lot in advance!
You won't be able to drag pedestrians, they actively move via PedMoveTo blocks. This is a creative idea but it will not work.
You will have to code your own heatmap using dynamically colored rectangles that you animate on top of conveyors. Doable, but might be more work than is really required for your purpose ;)
Long-winded question out of the way, I'll provide a diagram of what I am going for:
The red square represents the character, the blue rectangle represents the camera, the green dot represents the center of the "stage", and the black circle is the stage itself.
What I desire is to essentially lock the player's movement around the "center" of the stage, so that anytime you move left or right you are more or less rotating around said center. However, I also want the player to be able to move forwards and backwards to/from the center as well. Keep in mind I want the camera to always stay directly behind the player. I have tried many different methods, and the latest is the following:
I took a default actor, attached a spring arm, attached a child actor to that (gets possessed to become the playable character), attached another spring arm, and finally the camera to that. I then added the blueprint code to the first spring arm so that it was the one being controlled by the left/right controls. However, upon hitting play, the only thing that moves is the camera, and it can only move forwards and backwards.
I'm admittedly pretty new to Unreal Blueprints, so any help would be appreciated.
Alright, I figured it out.
Here's the setup needed if anyone else wants something similar.
For the player themselves, you'll need something like this:
The important thing is to center the root mesh where you want to rotate around. The spring arm's target arm length will be affected for the player mesh movement, giving the illusion you are physically moving the character. The second spring arm isn't necessary unless you wish to have more control over the camera to player distance.
For the rotation Blueprint, you'll need this:
The target is whatever you named the root mesh. (Mine was called Center) Drag and drop it from the hierarchy.
For the forward/backward movement, you'll need this:
The target is what you named the spring arm. (I left mine as the default "SpringArm") Again, just drag and drop it from the hierarchy.
Adjustments in Project Settings:
Yes, my inputs are backwards from what you'd think. I felt it was quicker just to reverse the inputs instead of adjusting whatever was causing the movement to be backwards in the first place. (It's probably just the sphere orientation.) Also, you'll notice I have the w and s inputs set to 5 or -5 instead of 1 or -1. This is due to the fact the movement was slow otherwise. I'm sure there's a fix that doesn't involve changing the input axis scale, but honestly I won't really have a reason to alter the values at any point in my project. If it ever comes up where I do need to, I'm sure there's a bypass to change the values from within blueprints anyways.
End result:
End Result Video
If I remember correctly, child actor components are a bit different from other components in that they are transformation independent, that is they do not update their transformation when their parent component moves around.
I find it a bit strange that you would separate your player actor and the camera component. Normally, the player "pawn" contains the mesh and camera components for one player.
I would suggest you do the following:
Create a player actor (e.g. a "pawn" or "character" class)
Create the following component hierarchy:
Root Scene -> Spring arm -> Skeletal or static mesh -> spring arm -> camera
Your root scene is the green center in your drawing. You can then basically use the blueprint you already have to rotate and move your player.