Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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
vote
2answers
118 views

Efficient collision detection of sphere with wall

I'm building a first-person game where up till now the player has been represented as a dimensionless point; this makes collision detection really easy, as I can just cast a ray along their velocity ...
1
vote
1answer
51 views

Optimizing Hitboxes

Way over 90% of the performance cost seems to be coming from colliders parented to animated bones. If I disable Motion & Animation I can spawn 20 soldiers with around 1ms cost on my mid-low end ...
0
votes
3answers
113 views

How do one NPC follow a succession of target points?

I have a project that contains 1 NPC (AI) and 2 target points. In the project I can make the NPC follow any of the 2 target points, but I can not get it to follow target point 1 and then target point ...
0
votes
1answer
34 views

Movement velocity relative to a static object (Vector Maths)

I have a static object. I have a moving player. If the player is moving directly towards the object then I want to return the value of 1. If the player is moving directly away from the the object ...
0
votes
0answers
6 views

Rotated movement in Gear VR Unity

So the player can move in four direction - forward, backward, right and left. But the forward direction should be from wherever he turns his gear VR controller. I have tried the below code, but when ...
0
votes
0answers
14 views

Changing controls in a new scene

I currently have a 2.5D platformer in the works for a college project, and the character can be moved with left and right. However, when entering a particular new scene, I want the character/player to ...
0
votes
0answers
8 views

How to switch between 2 game object while having it move at the same position?

I've been trying to make 2 input which change the state of a game object into another by setting one active and another inactive alternatively. But when you're in one state and you try to input the ...
0
votes
2answers
51 views

How do you make a object that always follow another object?

I'm trying to make a game object follow another game object and switch to another when a button is pressed. But right now it just seems to change the position when the button is pressed but it doesn't ...
0
votes
0answers
30 views

Smooth network movement lunge (UE4)

I am working on a melee in Unreal Engine 4 that lunges towards an enemy until it reaches it and applies damage. I have tried various approaches to get the movement looking smooth on the local client. ...
0
votes
1answer
32 views

How to properly handle sending arrow-key movement data to a authoritative server?

I've made a little C# server which receives UDP packets and shows me the incoming information. I want to make an authoritative server in C# which simulates character movement and interaction in a 2D ...
0
votes
0answers
26 views

when my cube touch the collider then stop my cube? [duplicate]

I put Box Collider on my obstacles but not stop my cube when touch the collider i try some code but nothing will be happen. ...
1
vote
0answers
50 views

Junk movement with steady 60fps on Web canvas

I'm new to building games on canvas, and I'm trying to create one. But I encountered a problem with sprite movements. My sprites move is smooth, but sometimes it starts to "jump". FPS is stable 60 ...
0
votes
1answer
34 views

How to make an object towards the mouse on one Axis - Gamemaker Studio 2

I am trying to have my "obj_playership" move towards the Cursor on a single Axis. Prefer it to be the Vertical Axis. I tried doing this is an "Execute Code Box" in a step event "direction = mouse_x" "...
1
vote
1answer
17 views

jumping and movement with rigidbody2d.velocity, gravity problem

i'm making a 2d platformer and i move my character with rigidbody2d.velocity swiping up to jump and moving while holding the left or right side of the screen. the problem is that when i jump and i ...
0
votes
1answer
68 views

How would I move something around inside of a sphere without it going outside of the sphere?

I want to be able to do this, but not go outside of the 4.4 meter limit, the radius is 4.4 meters, and it has zero gravity and no friction. I have a hard time explaining this, but imagine holding a ...
-2
votes
1answer
35 views

Moving a 2D object up & down y axis within certain limits

This was originally written to move a 2D object along the negative x axis. Now I also want to move the same 2D object along the y axis (up and down within certain limit and at different speed than ...
0
votes
1answer
112 views

Unity3D: Replicating SM64 turning movement into Unity

Brief Summary: I want to recreate Super Mario 64 turning movement into unity without the clunky movement I currently have. And I would also love how to implement the camera rotation system mentioned ...
0
votes
1answer
36 views

How to add undulation to a constraint-based chain?

I have a constraint-based chain composed of segments where each of the terminal segments has a fixed position. My constraints are set up as follows: ...
0
votes
0answers
31 views

How to make mobile movement using CharacterController

How can i change my movement for mobile i think left and right gonna work but i don't know what should i do for jump ...
0
votes
0answers
29 views

How can I stop my character's velocity in only one direction?

I'm moving a character by setting its velocity. It works perfectly and stops how I want it to however when I'm moving forwards and sideways at the same time and I stop moving either sideways or ...
0
votes
1answer
41 views

How do i prevent my player from walking through mesh collider

I have a character being moved using rigidbody.moveposition and I have an floating lowpoly island with a mesh collider. When my player walks into a steep slope or a wall, it passes right through. I ...
4
votes
3answers
114 views

How to implement smooth wandering on an annulus?

I am creating a 2D action platformer and want to create some steering behavior for a mage enemy. Basically, I want the mage to smoothly wander inside an annulus centered on my player. Below is an ...
0
votes
1answer
117 views

The character does not stand still on the moving platform

I'm trying to create a simple platforming game. I have an animated platform moving in 2 opposite directions. I use this simple code to make the character move along with the platform while he is ...
0
votes
0answers
36 views

Why does my character's collider only jumps with the animation while walking?

My character's collider only jumps with the animation while walking. And when he runs he gets stuck in the air and can walk in the air. Here's my script for jumping. At this point I have tried ...
2
votes
2answers
149 views

How to program smooth player 2D movements

I am writing a simple 2D game in Rust, having access to the following dependencies: Piston: for the graphic engine nphysics: for the physics engine The genre is Metroidvania, the game features a ...
0
votes
1answer
25 views

Why is Camera turning with different speed than Player with same code in different scripts? (with unity)

I want to integrate a running character in my game, so I downloaded the animation via Mixamo. The player is running and if I attach the camera directly to the Player it's shaking the camera and the ...
0
votes
1answer
62 views

Simplest way to make a car follow a route

To get the cars to follow the circuit, I mapped the circuits to several points. And using the move_towards_point function I make everything happen correctly. In ...
0
votes
0answers
167 views

How to get one KinematicBody2D to push another?

I am working in Godot 3, where my player is a KinematicBody2D. When I collide with a block which is also a KinematicBody2D I'd ...
2
votes
0answers
48 views

How to properly write “stick to surface” character logic that handles unexpected large time deltas?

I've been trying to wrap my head around this issue: in a 2D platformer game (but this may as well apply to 3D games) I want the character to "stick" to the surface that it's moving along and at the ...
6
votes
1answer
301 views

How do I store destructible terrain that characters can walk on?

I'm trying to make a 2d game like Worms (in JS, if it's important). I found 2 possible ways of implementing destructible terrain: Bitmap. Store every pixel in a huge 2-dimensional array Represent the ...
0
votes
2answers
130 views

2D character movement

My character moves right and left correctly, I want to know if it is possible to move character forward and backward to collect hearts (I know that in 2d no z axis I want to know if it is possible ...
0
votes
1answer
90 views

How do online games deal with lerp overshooting?

From what I understand, when you lerp in an online game, you travel from point a to b based on the elapsed time since the last update. The problem is when you have a higher latency, and you start ...
0
votes
1answer
63 views

Drag object with mouse in diagonal direction

I have a gameobject which i want to move using mouse. Currently i can do that in x-axis and y-axis: ...
3
votes
1answer
105 views

How to implement swooping movement?

I am trying to code some swooping behavior for a flying enemy in my 2D platformer. The ideal behavior has the enemy starting from an arbitrary height above the ground, then accelerating downward and ...
1
vote
0answers
36 views

How to implement back and forth steering behavior?

I am trying to implement some behavior for a flying enemy in my 2D platformer. The desired behavior is for the enemy to fly back and forth across the player, harrowing him. If the player was ...
0
votes
2answers
119 views

How to mitigate speed effects on moving platforms?

I am implementing horizontal moving platforms in my 2D platformer. The way it's implemented currently, when my player lands on a moving platform, he is reparented to it so that his position updates ...
0
votes
1answer
76 views

How to change object curve path in playmode in Unity?

I would like to make some sort of this simulation below, where user can interact with the white rod and drag it into the magnetic fields, which in resulting the blue line that represent the magnetic ...
0
votes
0answers
9 views

Implementing movement patterns using mouse mocap

I am working on a 2D action platformer and want to design some complex movement patterns for a boss that flies around the screen. Rather than describe the movement patterns using parametric curves, ...
3
votes
1answer
93 views

How to constrain a ball and chain like object?

Following up on this question, I have created a snakelike enemy which consists of a head followed by segments. I get the segments to follow the head by constraining each segment's position relative ...
1
vote
1answer
141 views

My Java Game's movement looks awfull. Maybe Problem with Thread.sleep

I have a big problem with my Java games. In every game I make the movement of the player and objects just looks awfull. The framerate is 60 fps without any problems. But the movement looks extremly ...
0
votes
2answers
221 views

Unity3d Move player with UI buttons

I'm trying to move the player based on UI buttons. I found this topic which covers the button listener: https://forum.unity.com/threads/touch-and-hold-a-button-on-new-ui.266065/#post-1944748 Now I ...
1
vote
1answer
85 views

How to synchronize moving hazards?

I am trying to implement a saw blade hazard in my platformer. The saw blade simply moves from point A to point B, and back, at constant velocity. (Let's assume all saw blades move at the same velocity....
0
votes
1answer
38 views

How do I move many “static relative to each other” objects around?

I'm currently building an Elevator Bank simulator in Unity3d and I'm stuck on how to reduce the amount of objects it's going to generate when it's done. The simulator will consist of one player (for ...
1
vote
2answers
87 views

How can I add left and right movement to my sprite without reducing forward movement?

I've made a character sprite that moves left and right when I press A and D, and moves forward automatically. However, whenever the character moves left or right, the forward movement is greatly ...
1
vote
1answer
942 views

Unity2D: Vector3.Lerp - smooth movement

I have a script that randomly chooses a position to move a game object every 5 seconds, however instead of moving my object smoothly, my script make my object jumps, which is not desirable! How would ...
2
votes
0answers
65 views

Camera that follows a target with sub-pixel movement

As the title says, I have a character that moves at sub pixel movement (no, I can't change this, because this sub pixel movement happens when I normalize the vector during diagonal movements, ...
1
vote
1answer
328 views

prevent animation from moving the character

As stated in the question I've this problem: I'm using Unity and when playing an animation my character moves from point A to point B without my consent. Here's the code: ...
0
votes
3answers
627 views

How do you program diagonal movement?

I'm wondering how a diagonal element that moves along a diagonal path that hops at each tick of the computer clock is able to travel a greater distance along the screen than an element moving at each ...
1
vote
0answers
68 views

How to get smooth movement in a low resolution game? [duplicate]

I am using monogame to make a simple platformer with a fairly low resolution. Right now I am struggling to get smooth movement like in the mario games. In those games despite having the low ...
0
votes
2answers
58 views

Bug with OnColliderEnter/Exit when colliding with multiple objects at almost the same time

Unity Version: 2017.4.1f1 I currently have a game with a jumping mechanic. I only want the jump to work where you're on ground, so I have planes on top of everything, which, if you are on a plane, ...