Questions tagged [movement]

A simple term for "translation", the change of position of an entity typically on the route of going from point A to point B.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Need help improving my Flow Field and Unit Avoidance code so that the units can properly surround a unit instead of getting stuck

My setup is like this. Every update my movement system moves all of the units on the field. They use some Boid logic to avoid eachother, and a flow field that directs them towards each other. This is ...
0
votes
2answers
59 views

How do I set the size of a single 'unit' in my game?

I'm currently trying to remake/port an old game created on Unreal Engine 2.5 to my own engine, and I have access to its physics data. It's using a scale of 80 units per meter, or 1 unit = 1.25cm. The ...
0
votes
1answer
35 views

How to handle movements of objects in a platformer with a cylindrical map?

I was wondering what would be the best approach for a game with a perspective like Resogun, where the world wraps around in a cylinder: In my opinion, the easiest approach is to: have a "...
1
vote
2answers
45 views

Free movement in a 3D isometric world

I'm currently experimenting with movement in a isometric perspective world and i'm thinking about how the movement should work. The movement can be either by WASD or gamepad. Since the player can ...
0
votes
1answer
27 views

How to implement Vector3.MoveTowards follow with random movement

I want to implement an AI behavior where an enemy runs towards the player while sidestepping randomly and aggressively (like in this video: https://www.youtube.com/watch?v=35Ut_C4eL40) Currently I am ...
0
votes
1answer
59 views

Make enemy move diagonally in 2D

I'm making the enemy follow the player only straight or diagonally e.g.(1,1)(1,0)(0,1)(-1,1). I expected the problem that I have, but I don't really know how to fix it. When my enemy is placed ...
0
votes
1answer
50 views

Is speed and direction generally combined into one vector, or separated into two?

Couldn't find this answered already, surprisingly. For example, for a game (in my case a 2D top-down one), there could be advantages to doing so. For example, whenever you want to change an entity's ...
0
votes
3answers
47 views

How to make UI image bounce back and forth inside another UI image?

I've been trying to create a battle system for my game, and I've been trying to get a UI image to bounce back and forth inside another image, but for some reason, the UI image goes out of the other UI ...
0
votes
1answer
26 views

Make movement speed relative to player character rotation in Unity?

I'm doing a strict topdown 2D game where the character looks at wherever the mouse is pointing (same perspective as GTA 2 or Darkwood) . I want to make movement speed for strafing and backing up ...
0
votes
0answers
47 views

OpenGL fixed function - WASD 2D movement

I need to make a simple object (like a turtle) move on a 2D scene. The keys w, s, a and <...
1
vote
3answers
78 views

2d diagonally velocity greater than straight-line velocity. How to fix?

If I have a topdown rpg type game. And movement in 8 directions (N/E/S/W/NE/NW/SE/SW) in a 2d game that involves both x and y velocity. I'm finding when i'm moving in the diagonal directions i'm ...
0
votes
1answer
16 views

Maintaining facing direction at the end of a movement

I want to make my 2D top-down walking animation stop and revert to the idle animation while continuing to face in the same direction as the previous movement. For example, when I go up then stop, my ...
0
votes
2answers
111 views

Moving ship to new destination when already having a velocity?

Feel free to skip to the bottom and see the actual question. NOTE: Question updated below based on comments I am trying to make a space game and implement basic movement, unlike most, this is a ...
0
votes
1answer
15 views

Make transform.up face toward velocity while preventing transform.forward from rolling?

I have been working on a personal project that is suppose to mimic Anthem. I am using a state machine for the character controller that I intend to integrate with the Unity's Animation state machine. ...
3
votes
1answer
62 views

My Earthbound-like Movement Script works in Unity Gameview, but runs differently in Gamebuild

First programming question I've ever made in my short journey. I'm trying to create a script which moves members of your party in a line behind you (think Chronotrigger or Earthbound). Here's a clip ...
0
votes
0answers
66 views

How to have RTS units move along un-even terrain?

My current world is a flat 2D plane. I want to make the terrain 3D, like hills, bumps, etc. If I tell a unit to go to a position (x, y) in 2D, how do I make sure ...
0
votes
0answers
30 views

How can I make player object collide and keep moving until it is as close as possible to click location?

I am making a basic point and click adventure game. I can make the player object move towards the location of a mouse click and collide with walls, but movement stops the instant a collision occurs. I ...
0
votes
0answers
26 views

Steering - Flocking with stopping without jittering

I have a simple steering system that integrates flow-field based path following and separation behavior that I use to control hordes of creatures. These creatures follow the flow-field, but if a ...
0
votes
0answers
27 views

diagonal movement to a enemy in pygame

I spent a long time trying to make the diagonal movement in the form of code but I don't know how to write it. the code I have so far is almost complete but it is missing the pixelart that I will add ...
0
votes
0answers
7 views

Move object along world X/Z axes taking account it's own rotation

I have a camera 9 units up, tilted down at a 60° angle (rotated around it's X-Axis), which means forward for the camera is pointed down at the floor as shown in the picture below Now when I press W, ...
0
votes
0answers
38 views

Unity rigidbody velocity

In Unity, what is the correct way to move a game object by modifying the velocity of its rigidbody? I'm having some issues with stuttering movement, so I just want to make sure I understand the basic ...
-2
votes
1answer
28 views

Help understanding movement script

Can someone clearly explain how this script works and how I would be able to improve it? (It's a movement script) ...
0
votes
0answers
20 views

Endless runner character stops moving unexpectedly

I've been trying to make an endless runner game in Unity in which a player moves forward automatically and can move from x to y axis while still moving forward. I do not know how to program so I used ...
0
votes
0answers
20 views

Dashing mechanic in top down projectile dodging game in pygame

im making a simple third person top down game where you dodge projectiles than fly in from either side of the screen, its a simple high score game where the longer you avoid being hit, the better your ...
0
votes
0answers
15 views

Screen boundaries seem randomly placed

I have a strange issue in which the characters boundaries work fine, however are placed at four seemingly random edges outside of the game view as a result of (I'm assuming) my player boundaries ...
0
votes
0answers
12 views

PYGAME - Sprite movement seize to function when entire X and Y span is reviewed

I've created an sprite class that has a detection radius checking if the player enters the zone. If yes, the sprite moves towards the player. It works perfectly fine when the sprite checks for three ...
0
votes
1answer
43 views

Control how quickly 2D vehicle straightens out

I'm implementing vehicle movement in a 2D environment, where a vehicle consists of a front and a back "axle", both represented as 2D points. When the front axle moves, the back axle should ...
1
vote
0answers
22 views

User input scheme of 2d vector field on a 2d plane for navigation

I want to create a strategy game based on distributions of "units" which can be moved around and attack each other. By distribution of units i mean that i don't have any discrete units ...
0
votes
0answers
15 views

Cinemachine third person camera movement causes misalignment

I'm working on third person movement using CinemachineFreeLook as the player camera. At first I thought it was working fine but I've noticed that moving left/right actually moves the character with a ...
0
votes
1answer
28 views

Buttons only trigger right/left movement once, not continually

I have a Unity mobile project where I am trying to use right/left movement using two UI buttons situated accordingly. The issue is that it only moves the player to the right/to the left one time, not ...
0
votes
0answers
36 views

Path following with turning radius and obstacle avoidance

I would like to move an object through a path found by A* star but taking into account the object's turn radius and movement speed, while also avoiding possible obstacles during a curve. After some ...
0
votes
1answer
39 views

How to stop sliding properly

I wanna stop immediately (not instantly) when I release a key so it would not slide. I don't wanna use rb.isKinematic = false; because it's just stopping so instant....
0
votes
1answer
18 views

Having trouble combining clampMagnitude and some explosion force

I have a character that uses rigidbody, and I am using AddForce() to make it move. And so I do ...
0
votes
0answers
22 views

When I use rigidbody.move rotation, my player sinks

I am trying to implement a simple movement on an object and when I use movePosition from rigid body, the player starts to sink: How can I resolve this issue? Below ...
0
votes
1answer
72 views

Why do I get a jitter/stutter when moving and following a target?

I am using the script below to move a transform to quickly follow a target (the player), and come to a stop close to the player. When I move the player around, the transform is following the player, ...
3
votes
2answers
70 views

Interpolation on Rigidbody2D not working

I'm trying to achieve smooth movement for a ball. I seem to be failing to achieve this and now I've created a sample scene, which shows my setup from the game and the problem exists in that sample ...
0
votes
1answer
22 views

Clipping speed when turning without using aggressive drag

I have a Unity project in which I want to control a player in a similar way to Source games, and so far I am clipping each input to the speed in the player's coordinates, by using ...
0
votes
0answers
36 views

How to implement framerate-independent acceleration depending on current velocity

For my client/server application, I've implemented framerate-independent acceleration like this. Now I've advanced my formula to be using the current velocity of the moving object to calculate the ...
0
votes
0answers
52 views

Move enemies over the network without sending their positions

I am trying to move enemies on two clients without sharing their positions. I use this: startingPosition + GetRandomDir() * Random.Range(1f, 10f) To have the same ...
2
votes
2answers
159 views

Should the entity handle his own movement?

I am currently building a simple turn based game with a Room consisting of a 2D array of Tile objects. Those can be WallTile or FloorTile. Tile objects have a north, east, south and west Neighbour. ...
0
votes
2answers
260 views

How can I fix “Cannot read value of type Vector2 from composite” error in Unity?

I'm making a 2D game with Unity using the new Input System. I used spriteRenderer.flipX to flip the player but since it is made of three parts (body and two eyes), ...
2
votes
1answer
118 views

What's causing this stutter when framerate fluctuates?

I'm working on a class responsible for arm sway in an fps engine, and am having an issue with a stutter that appears to be related to fluctuating framerate. However I have also noticed it when locking ...
0
votes
1answer
86 views

Why does ForceMode.VelocityChange work but not Rigidbody.velocity = … in script?

I have a FPS movement script that I created that has a jump function that looks like this ...
0
votes
1answer
59 views

How can I implement a Varying Jump Height Mechanic for my character?

First of all I want to mention that English is NOT my mother tongue, I am using GODOT to make my game and that I am only 16, so I don't have any prior programming experience, although, I understand ...
0
votes
0answers
24 views

Script not working (Function not changing value)

I have this script that I made for an FPS character. public class Player_Movement : MonoBehaviour { public CharacterController controller; public Transform camera; ...
0
votes
1answer
53 views

2d gravity simulator - smaller object orbiting towards center of bigger object

In my libgdx test game, I have initially created 2 circle objects (stellar) about which I will say more in details below. However, my goal is to simulate gravity in 2d, where smaller object orbits ...
0
votes
1answer
31 views

Help with moving object to mouse position

I'm trying to make an object follow my cursor using raycasting. I'm creating the raycast each frame and checking the player's distance from the hit and whether or not the hit landed on an object ...
1
vote
0answers
25 views

Large values for Rigidbody Velocity (UNITY3D)

I'm making a simple FPS game. I've come across this problem that I am unable to solve for quite some time. If this is question has already been asked before then do let me know. The problem at hand is ...
0
votes
2answers
54 views

Sliding movement on a grid

I'm trying to implement "sliding" movement on a simple grid, where the movement vector is continuous (floating point direction) but the grid is discrete (boolean blocked or open on integer ...
0
votes
0answers
30 views

Player can only dash towards to the top right, but can't in any other direction?

I have a dash mechanic, but it only seems to be working when the player is going up, down, left, right, or to diagonally to the upper right. It won't work diagonally in any other directions, and I can'...

1
2 3 4 5
19