UE4 Blueprints – AI movement on moving platform/object (like a ship deck)

I want to have AI (enemies) on a boat that moves on a path around the level (an island). But the AI seems to have a problem navigating on the deck of the ship. They always end up on the far back of the deck (they move with the ship, but it seems the target location of their movement is always lagging behind the boat, so they always end up on the back end of the deck). The navmesh is set to dynamically rebuild, but that doesn’t seem to be enough.

I’ve read on other forums that you could create a copy of the ship that is hidden somewhere not visible and doesn’t move, and use that to calculate the navmesh and the movement of the characters and then use the results to move the AI on the actual moving ship, but I don’t know how to even start doing that. How do I tell the AI to use the unmoving boat to calculate the movement, and how do I ‘translate’ it back to the moving boat?

Unity – Companion AI with NavMeshAgent causing jittery movement on the X-Axis

I’m trying to do a companion AI that follows around my player but with a certain distance. I first tried to self-program the movement behavior. but realized quickly that a NavMeshAgent offers more simple solutions to what I’m trying to archieve.

Now the problem is that my AI doesn’t follow around smoothly. It’s surely not because of the camera, since my player and my enemy AIs do not have these jittery movement. My script is as simple as it can get:

private Transform target; private NavMeshAgent agent;  public Animator partnerAnim; public GameObject player;  private void Start() {     // set target to player transform     target = GameManager.GM.playerMachine.transform;     agent = GetComponent<NavMeshAgent>(); }  private void Update() {     // Determining wether to play the walk animation or not     partnerAnim.SetFloat("normalizedSpeed", Mathf.Clamp01(agent.velocity.magnitude));      agent.SetDestination(target.position); } 

My stopping distance is at 2 and my speed is at 3.5. No matter how I change these values, the jittery movement won’t change.

I also have a rigidbody attached to my NavMeshAgent, and I made sure to turn on "isKinematic", and I also removed it to check if that solves the problem, but it didn’t.

The weird thing is that it only seems to be a problem when moving along the X-Axis. When I move on the Z-Axis only, my partner is following my player smoothly (I’m guessing this is because I increase the speed of my player on the Z-Axis, but I don’t really see the connection with my problem here. If it would be a speed problem, then lowering the speed on my AI would’ve fixed this, but it didn’t.)

Here are the full NavMeshAgent settings.

If you have any guesses please let me know. Thanks in advance!

Unreal Engine 4 AI Character Pawn Entirely Unresponsive to Movement Commands

I’m new to game development and to Unreal but I cannot for the life of me get my AI character pawn to move at all using any method I know.

I’m developing a 2d Sidescroller game using a Tilemap. I have made sure collision is set up with the map and tiles, the player character can interact with it all just fine, and I made sure to widen the collision thickness of the map so that the navmesh can properly appear (as seen with the green areas).

Nav Mesh loading. AI spawns in the air and falls down so I know he isn’t overlapping with the ground Nav Mesh loading. AI spawns in the air and falls down so I know he isn't overlapping with the ground

I’ve disabled and enabled collision for the static mesh cube component in the character pawn, but he still doesn’t move. The goal is to get him to follow the player when he sees him. The pawnsensing trigger works just fine, as I had it print whenever he sees him, and he even properly gets to the point of executing the "follow player" function (the print statement works).

However, using AIMoveTo fails every time. I’ve tried putting the player as the target, the player’s worldLocation as a vector, and even an arbitrary point vector to the right of the AI but AIMoveTo fails every time.

I’ve deleted and replaced the NavMesh, and I’ve even tried completely skipping using AIMoveTo and just using Add Movement Input in both the AI Thinking Blueprint and Character Pawn Blueprint but neither make it move. I literally put an Add Movement Input function on the Pawn’s event tick but it never moves.

Any suggestions?

Code: AI Logic event is triggered every tick AI Logic event is triggered every tick

Character Pawn Tick (for debugging). Does not cause the Pawn to move Character Pawn Tick (for debugging). Does not cause the Pawn to move

Trying to get player movement from a class [closed]

I working on my game for the Ludum dare 48 game jam. I decided to learn raylib, the c++ version, to make a game. But my player code doesn’t even work. I have two files:

#include "raylib.h"  int main() {     const int windowWidth = 1200;     const int windowHeight = 720;     InitWindow(windowWidth, windowHeight, "Ludum Dare 48");     /*Player*/     Player ply;     /*end of Player */     int rot = 0;     int increment = 1;     SetTargetFPS(60);     while (!WindowShouldClose()) {         BeginDrawing();         ClearBackground(RAYWHITE);                  ply.yes(windowWidth/2, windowHeight-50, 30,30);         EndDrawing();     } } 

and player.cpp

#include "raylib.h" class Player {     public:     int playerX;     int playerY;     void yes(int x, int y, int sizeX, int sizeY);     void input();              }; void Player::yes(int x, int y, int sizeX, int sizeY) {     DrawRectangle(x,y,sizeX,sizeY, RED);     if (IsKeyDown(KEY_RIGHT)) {             x++;         }         if (IsKeyDown(KEY_LEFT)) {             x--;         } } 

I get the error:
cc1plus.exe: warning: command line option '-std=c99' is valid for C/ObjC but not for C++

it looks like a compiler error, not an error in my code, but when the class is removed the code runs fine.

2D Isometric Movement – Straight Line to Mouse Position

I’m developing a 2d isometric game on a engine made by myself (as a way to practice Java), however i’m stuck on what it seems to be a math problem, since I’m very bad at it. I can’t figure out to get the angle and change the X and Y velocity based on the angle.

I wish I could have some help on how to implement a 360 degree movement system based on Mouse Position, but the character should move in a straight line, based on the mouse angle relative to the center of the screen (where the player will be). The screen itself should work like a compass, and where the mouse clicks on it, the character should walk on said angle.

Example, my native resolution is 512×288. Center point is 256×144. So, If I click in in the coordinate of X = 256 and Y is 0~144, the character should walk on a perfect stright line upwards. If Y is 145~288, then, a perfect line downwards.

Any help is welcome!

enter image description here

Godot : Kinematic body moves in opposite direction after i interpolate its movement

i have added some basic movement and some manual interpolation to a cube tat is a kinematic body in GODOT

extends KinematicBody  var speed : int = 10 var slowdown_buffer = 0.2 var movement = Vector3(0,0,0) func _ready():     pass      func interpolate():     if movement.x > 0:             movement.x -= slowdown_buffer     elif movement.x < 0:         movement.x += slowdown_buffer     else:         movement.x = 0.0 func _physics_process(delta):     if Input.is_action_pressed("left"):         movement.x = -speed     elif Input.is_action_pressed("right"):         movement.x = speed     else:          interpolate()              move_and_slide(movement) 

The problem is that when i move the cube using the A and D
After the Cube stops after the interpolation , it starts moving in the opposite direction in a non increasing speed
How to fix this

Does a monk with Unarmored movement still have to make strength checks to “run”/”climb” a wall?

If a Level 9 (or higher) monk, with the Unarmored Movement feature, wanted to climb a 1000-ft sheer cliff, would they have to make strength checks every turn to see if they continue climbing, fall, or stay where they are? Or would they just keep going without making checks?

(Related question.)

Mythic Black Tentacles vs. Freedom of Movement (pathfinder 1)

My group has a question about Mythic Black Tentacles vs. Freedom of Movement. For reference: https://www.d20pfsrd.com/magic/all-spells/b/black-tentacles/ https://www.d20pfsrd.com/magic/all-spells/f/freedom-of-movement/

The important parts…

From Black Tentacles:

The tentacles can grapple creatures that are immune to grappling if that immunity is from a non-mythic source, but combat maneuver checks to grapple such creatures take a –5 penalty.

Freedom of Movement, broken down apart by me:

Point 1: All combat maneuver checks made to grapple the target automatically fail.

Point 2: The subject automatically succeeds on any combat maneuver checks and Escape Artist checks made to escape a grapple or a pin.

Our current thought is that if someone has FoM up and they’re hit with Mythic Black Tentacles, they can be grappled, because the text of MBT overrides Part1 from FoM.

But then, on their turn, they can automatically escape because of Point 2 from FoM.

Does anyone else have this in play? What do you do?

Thanks in advance.

movement of 2d object

I was trying to move object by changing velocity

void FixedUpdate()     {         int velocity_x = rb.velocity.x;         int velocity_y = rb.velocity.y;         if(Input.GetKey("a")){             if(velocity_x<0){                              }else if(velocity_x>0){              }             else{                 velocityChange(-1, 0);             }         }else if(Input.GetKey("w")){             if(velocity_y<0){                              }else if(velocity_y>0){              }             else{                velocityChange(0, 1);             }         }else if(Input.GetKey("d")){             if(velocity_x<0){                              }else if(velocity_x>0){              }             else{                 velocityChange(1, 0);             }         }else if(Input.GetKey("s")){             if(velocity_y<0){                              }else if(velocity_y>0){              }             else{                velocityChange(0, -1);             }         }     }      void OnCollisionEnter2D(Collision2D collision){         if(collision.collider.tag =="obstacle"){            Debug.Log("Finish");         }     }     void velocityChange(int velocityX,velocityY){         rb.velocity = new Vector2(velocityX, velocityY);     } 

But, I am getting error.

Assets/movement.cs(57,48): error CS1001: Identifier expected

57 line :

void velocityChange(int velocityX,velocityY){ 

48 line :


40-49 line :

else if(Input.GetKey("s")){         if(velocity_y<0){                      }else if(velocity_y>0){          }         else{            velocityChange(0, -1);         }     }