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.
1,064 questions
0
votes
2
answers
121
views
Why is my rigidbody not moving when I press the buttons? I can't see any reason it shouldn't
The "Car" in question is a plane. The question is pretty self explanatory.
Here's the Car in the Hierarchy:
Here's the car in the inspector:
And here's the PlayerMovement script:
...
-1
votes
1
answer
125
views
How can I implement a fish character with a “chargeable tail” mechanic
I’m trying to replicate the fish physics from Fish Volleyball.
If you want you can try demo of the game or watch video preview
The unique part is that the fish doesn’t jump normally — instead, when it ...
0
votes
0
answers
121
views
Why does this code behave strangely with different camera angles?
Relevant to this issue are two MonoBehaviour scripts: Actor and Player. ...
1
vote
2
answers
484
views
How do I implement the "collide and slide" algorithm in Unity?
I've recently been attempting (and failing) to create my own character controller for my 3D Unity game for around a week. I hate the Unity rigidbody physics system for making a character controller, ...
1
vote
0
answers
133
views
Original pacman hitboxes and cornering
I have been working on (somewhat) faithfully reimplementing pacman as a sideproject and means of better learning the rust framework Bevy.
However, there is one part that I really cannot quite get my ...
0
votes
1
answer
121
views
How to instantly stop when moving the character with AddForce?
I made character movement using AddForce. But I don't understand how to get the desired effect. I need that when I release a movement key (for example WASD) the ...
1
vote
0
answers
70
views
How to move objects in a wavy pattern in a specific or given direction?
I'm making a bullet hell and I want to handle a variety of movement types for my bullets (waves, flying in circles, spirals, etc). I'm currently using the following to handle linear movement at a ...
0
votes
1
answer
154
views
Fixing the player movement with SDL2
Whenever I create a project with SDL2, I always encounter the same issue: when I hold down a key (for example, W for upward movement), it moves on the first frame, doesn’t move on the second frame, ...
2
votes
1
answer
188
views
How to adapt the Anya any-angle pathfinding algorithm to handle non-discrete start/target positions?
Recently, I have been investigating the Anya pathfinding algorithm.
Anya is an optimal any-angle pathfinding algorithm.
However, it works only with discrete points on the grid.
Here is an excerpt from ...
1
vote
1
answer
105
views
Should I use UDP to create a movement logic like League of Legends?
These are features of my game.
You can only move by clicking the mouse like LOL.
30~50 players can play at a time. (So the game map will be larger than LOL)
No jump
Should I use UDP to update client'...
0
votes
1
answer
89
views
Have enemy move toward player when spawned
Have an basic enemy prefab that when spawned, I would like it to lock to player and move toward them, with smooth rotation. However, as you can see in this video, the enemy initially moves away from ...
1
vote
1
answer
157
views
Simple Party/Player Movement for Top-Down RPG
So, to keep it short, I am developing a simple top-down RPG. The player (and party) can only move in 4 directions. Seems really simple, but I have not been able to find a good answer on how to ...
0
votes
0
answers
168
views
How to make an object rotate in local space then translate in world space using Raylib?
I'm trying to make a rubber duck move along the surface of a round 'world' - I should be able to rotate the duck on it's local Y axis and then move the duck forward, with the duck following the ...
0
votes
0
answers
45
views
Player's speed staying constant
I'm having a problem with the code below. My player is always moving at the same speed. Even if I give my boast variable a very small value, the speed remains same ...
0
votes
1
answer
225
views
3D Dark Souls lock-on code: Player moves around target in a spiral, not perfect circle
I'm working on a 3D game in Unity that requires lock-on, or Z, targeting found in games like Dark Souls and Legend of Zelda: Ocarina of Time.
The code that I have achieves my intended goals fairly ...
0
votes
1
answer
104
views
How to make movement relative to player rotation using Rigidbody.AddForce() in 3D Unity?
I'm making a 3D game and I was trying to make movement relative to player rotation for several hours, but I failed. Here's the code, maybe I made a mistake there. Also, player doesn't rotate.
...
0
votes
1
answer
542
views
How to make an enemy able to walk on walls in Unreal Engine?
I'm working on my 1st title called Infernal,
and I'd like to make the enemy able to walk on both ground and walls.
For exemple: let's say the enemy is running towards the player and he gets shot. ...
0
votes
2
answers
118
views
How determine whether a quad of a grid mesh is too steep to move onto, without using a NavMesh?
Godot 4.1
Assume we've got a simple, 100x100 cells grid-based generated mesh that will serve as the game's level:
This mesh is exported as either .obj or .glb and imported in Godot.
The player (...
0
votes
2
answers
219
views
How to properly predict movement on a server authoritative game
I've been developing games as a hobby for a few years now and one thing that I like to do is to replicate games or a specific mechanic about them to understand how they work. I am sorry in advance ...
2
votes
2
answers
134
views
Improving local collision avoidance to navigate around large obstacles
For my collision system I’m using a boids-like method that works fine for "small" obstacles (like other characters) where the character can turn slightly left or right to avoid the obstacle ...
0
votes
0
answers
111
views
Need help controlling a 2d rocket to reach target positions at velocity vector constraints
The problem:
I have a rocket in a 2D space game that can apply force forwards and apply torque to turn. Now I want this rocket to reach a target point in the x,y coordinate system with a certain ...
0
votes
1
answer
138
views
Adjusting unit orientation to the terrain
I'm working on RTS game and got stuck on a pretty simple question I think, but I'm not skilled enough to find the proper answer. I don't want to use Unity built-in physics to do the job for me and I ...
1
vote
1
answer
95
views
Object moves continuously and won't stop until it hits an obstacle
So im fairly new to coding and don't know much and so I decide to improve this line of code I had before, by finding something online and now my object is constantly moving and won't stop unless it ...
0
votes
0
answers
55
views
Why do my entities have jittery movement, where their velocities fluctuate wildly between frames?
I'm writing my own simulation for some robots. I want to utilize friction, acceleration, velocity calculations.
Currently, my code looks like this:
...
0
votes
0
answers
135
views
Why do I have to freeze my player's x and z rotation to make my player movement work and why does my camera stutter when colliding with things?
So I have an empty object called player with the PlayerMovement script and a rigidbody. I have the main camera and player visual as childs of it. The movement works ...
1
vote
1
answer
341
views
How to make AI Character move towards Actor Object
I have in my scene an AI Character and Actor Object, but the character won't move no matter what I've tried. You can see the current code with debug statements. I'm not sure what I'm missing because I'...
0
votes
2
answers
100
views
How can I implement actor velocity / acceleration with fluid changes if direction changes are small, and abrupt if the direction changes are large?
I hope the question title makes sense. I haven't been able to google for an answer because I don't know what the correct terminology I'm looking for is.
Basically, I have an actor / enemy / game ...
0
votes
1
answer
122
views
Is it possible to design character movement system with Bezier Curves?
For context, I'm trying to create a really dynamic and fast character. That can suddenly move slow, fast, zap into places, dash, and hover in place.
Say that I want to make a character accelerate a ...
0
votes
0
answers
76
views
How to make smooth movement for a tunnel traveling music game?
I'm creating a music game where the player travels inside a tunnel and can create twists and turns while listening to music. Here's a video showing what it currently looks like.
I'm looking for advice ...
0
votes
3
answers
252
views
How to make camera follow player on Y+ axis only
My player is jumping on sticks, endlessly going upwards, and if they fall, it's game over.
I want the camera to follow the player only when they move up (ie. only on Y axis), not down. If they move ...
0
votes
1
answer
98
views
Circle to Polygon & Circle to Circle Velocity Resolution
I am working a 2d physics engine.
Polygon to polygon collision and velocity resolution works without issue, but I am struggling to get working circle to circle and circle to polygon velocity working ...
10
votes
3
answers
3k
views
How hard to brake to perfectly smoothly reach the destination?
Goal
I want the get the required minimum deceleration to perfectly smoothly reach a target.
(The car's AI should know how hard it has to brake to be the perfect valet.)
Research
"How can I ...
0
votes
2
answers
162
views
Max velocity for smooth deceleration to destination
I am able to update velocity of my agent every 0.5 seconds. My agents max speed is 5f/s and max acceleration/deceleration is 2f/s.
I know how far away I am from the destination. How to determine ...
0
votes
1
answer
211
views
My CharacterBody3D Is getting blocked by ramps that act as walls
To summarize, my ramp is acting like a wall even if it is created to have a collision and mesh that fits its shape.
I have tried:
Putting the max angle to 90
using different ramps (CSG & mesh)
...
0
votes
1
answer
122
views
How to add gameTime to movement with acceleration and diagonal normalization?
I recently started rewriting my engine from scratch, because the old one was my first attempt and the structure was very messy. Everything has been going great, but now I'm being held back by some ...
0
votes
0
answers
114
views
How can I efficiently load and unload regions of a world as the player moves?
I am creating a game with infinite terrain. Sections of the terrain are broken up into regions of fixed size for handling (similar to chunks in Minecraft). I would like to load and unload them as ...
1
vote
1
answer
131
views
Flying AI shakes when chasing and avoiding obstacles simultaneously
I've got a problem with my flying AI in Unity. When it just chases a target it's ok, but my system contains avoiding obstacles so when it starts to do it, it shakes weirdly.
As I understood using <...
0
votes
1
answer
105
views
Sprite chasing a target using move_towards_ip does not move
I'm trying to get a turtle sprite to chase a falling algae sprite utilising Pygame's inbuilt functionality. I have spent many hours reviewing questions and answers and suspect I'm missing some ...
0
votes
0
answers
68
views
Determining meters per second in scaled terrain
I have a terrain with a width of 199 and height of 99 and I'm scaling this train by 500. What would be 1 meter in the new terrain, would it be 500? I'm trying to move my character in meters per second ...
2
votes
1
answer
133
views
How to make redirected player movement respond to same key?
I have a 2d game (Godot 4) with different rooms with portals to go between them, and some portals redirect the direction of the player while still holding the same key. I have that working so far, but ...
0
votes
1
answer
452
views
How to code glider movement in 2D? (Godot 4)
So in Minecraft, you have the elytra. When you look up, the character moves up. When you look down, the character moves down. The speed you move forward depends on the angle you are moving. I want to ...
1
vote
0
answers
87
views
Move UI element by a specific amount relative to current screen resolution
I want to achieve the following:
At some point in the game, the UI Image (dashed rectangle) should shift towards the right edge of the screen (black outline rectangle) up until the part of the image, ...
0
votes
1
answer
82
views
Why are the transform game objects moving away from the snail when they are swapping their direction?
I am making a game in which I created a character (main player) and another character(snail). Now the snail will move on the ground, when there is no ground detected it will change its direction. I ...
1
vote
1
answer
85
views
KinematicBody2D stutters/moves back and forth
I'm working in Godot 3.5, and trying to set up a navigation polygon for my kinematic body to mode around inside, but when I try to send it to some point, the body 'stutters'/moves back and forth in ...
0
votes
1
answer
523
views
How to make enemy turn to face the player while attacking?
I need help making this code work. It is made for the enemy AI to move and patrol, chase the player and attack the player.
The problem is when it starts to attack the player, then the player can move ...
0
votes
1
answer
353
views
PyGame moves object in one direction but not in the opposite one
I'm having trouble with a PyGame animation I'm writting. I have a Ball class that defines an object that moves on the screen and bounces on the edges. I initialize ...
0
votes
1
answer
126
views
How to use WASD to move camera between a collection of position marker objects?
How can I move one camera between two positions along the cardinal directions?
Using W/A/S/D keys, I want to move the camera from one empty object to another on the xy plane. Those empty objects ...
1
vote
1
answer
157
views
Move object continuously along y with optional movement along x
I am looking for a sensible way to continuously move an object downwards with constant speed while moving left or right by some amount x when the user presses the left or right arrow keys.
Basically, ...
5
votes
1
answer
250
views
Avoiding nausea when spinning
I'm working on a top down space sim where the ship fills most of the screen and has a fixed heading, i.e. the front of the ship is always at the top. However, there are stars in the background, so ...
0
votes
0
answers
266
views
Trying to get a Character to face the direction based keys pressed left or right instantly
I finished up my movement script which is finally working fantastically. The only issue I am having is getting the character to face the direction when I press either left or right on the keyboard. ...