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
1answer
18 views

How can I get the basic Unity player controller to move based on a gameobjects rotation?

I am making a basic movement script based off of the built in playercontroller in Unity. I am trying to get the Player gameobject to move forward based on its own rotation (i.e. if it is rotated to 90 ...
0
votes
0answers
36 views

Apply external effects to player movement

In a 2D downhill game with the following, custom movement code, how do I apply external effects to the player's movement? For example, when the player hits an obstacle, I want them to get bounced off ...
0
votes
0answers
45 views

Why is my movement not smooth and jagged?

My game isn't smooth, it runs at 60 fps but has quick lag spikes just under every second. I really can't figure out why. I have a feeling it's to do with my player movement code. My rigidbody's ...
-1
votes
1answer
66 views

My character is not switching right or left like subway surfer in 2D?

I am making a 2D subway surfer type of game right now and I found this code on the internet that switches the lane of the player but the problem is it doesn't switch. When I play the scene it won't ...
0
votes
1answer
36 views

Unity: AddForce in transform.forward direction not working as expected

I am building a very simple car-driving game in Unity. I have a Player object, which looks like this: As you can see, I have a Rigidbody2d component attached to this object, as well as a script, ...
0
votes
1answer
40 views

Prevent Wall Clipping with Bouncing Shape

I'm currently working on a demo-type program involving bouncing objects. Currently, I have a rectangle that can bounce around the screen. When the rectangle bounces against one of the walls ...
0
votes
1answer
16 views

Why doesn't this movement script work, while the other one does?

Im trying to get a rigidbody2D to move around and got it working with this script: ...
0
votes
1answer
48 views

move along given path relative to the inital position

how can I move an object along a path "relative" to its inital position? I want it so if the object is initially positioned "around" the path instead of in the center, it will move along the path ...
0
votes
1answer
494 views

How to get the actor to follow the mouse while clicking and holding?

I am trying to do the top down project from scratch. I can already get the actor to move toward the mouse click: Only I need to keep clicking several times to change its path and keep walking ...
1
vote
1answer
76 views

Javascript snake game, configurable section distance

I want to make a snake game. In a classic game the snake moves in 4 directions, I want the player to move in all directions by mouse input, similar to slither.io Right now the tail section changes ...
0
votes
2answers
64 views

The camera goes up and down when following a rolling sphere

I have this CameraController script attached to my camera, to follow a sphere that moves using WSAD. ...
0
votes
0answers
22 views

Clamping after forcing aspect ratio

I'm using the following script to force aspect ratio of 16:9: https://forum.unity.com/threads/force-camera-aspect-ratio-16-9-in-viewport.385541/ It works perfectly. However now my game objects are ...
0
votes
0answers
16 views

Movements don't work the way it should

I'm trying to make some basic animation, but I ran into this problem. Whenever I move with WASD, it teleports instead of doing the walking animation. Also the idle plays only one time, then it stops: ...
1
vote
3answers
3k views
0
votes
0answers
8 views

Moving object along X and Z plane relative to camera

Using keys, I'm trying to move a cursor object across the X and Z plane, keeping it relative to a camera that I can orbit around the playfield. This is my code so far, and apologies...I'm about 2 ...
0
votes
1answer
29 views

Is Updating Sprite/Entity Movement Using Framerate Necessary?

Apologies if this is a dumb question I'm still new to this, but I'm trying to understand if calculations of sprite movements/hitboxes/etc. is necessary or is generally better than just using fixed ...
0
votes
0answers
11 views

How do I select my platform and move them in a specific place in gameplay?

I saw this game called TaniNani and I was amazed by the concept of the game and I would like to try to replicate it! My goal is to let the player hover on the available grid (somehow like hovering ...
1
vote
1answer
165 views

Game object appears to accelerate too slowly

thank you for checking out my issue! I am trying to develop a game in java, but I have run into a problem. I would like to keep the physics as realistic as possible, so I am using a fixed time-step ...
2
votes
2answers
175 views

8-way 2D top down movement (diagonal) idle animation issues

Background I am working on animations for 8-way movement for my character and have done the 8 directional running animations using a blend tree. Now I need to do the same for the idle animations. ...
0
votes
1answer
1k views

What is a good approach to dynamically change actor Position?

In my card game there are 2 players with each player having a hand(a ListArray of of Cards.In this case its ...
0
votes
0answers
8 views

Clamp 2d not working in Main scene (Godot3.2)

In Godot3.2,clamp2d(Player) works in standalone scene but doesn't work when instanced in Main scene(both as Child node through Scene ui and as a Packed Scene ...
0
votes
3answers
69 views

Move with velocity based on rotation

So I have a simple script to move a character. The problem is that no matter where i'm looking at (my y rotation) it always makes me go the direction if I try to go forward, but I want it to go toward ...
3
votes
2answers
375 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
0answers
20 views

Why does rb.velocity blurrs background?

My player controller code is bellow. So is my player inspector. This makes my character move yet it blurs the background, but when I use ...
0
votes
0answers
14 views

Character either stuck in idle or character animation in unity

Im making my first game in unity. And Now I have this problem: my character is stuck in his running animation and I can't move him at all (when I'm trying to play the game). There is also this weird ...
4
votes
3answers
14k views

How to check if grounded with rigidbody

Does anyone have a better way to make an object with a rigidbody check for ground and then jump, right now I wrote a script where a raycast is cast downwards and it checks for distance but then I ...
0
votes
0answers
29 views

Player losing alignment with tilemap after moving

I'm using an isometric tilemap(2:1) and I can't figure out how to make grid based movement on it's surface. I managed to get a code working for the grid based movement, moving my character with 0.5 ...
1
vote
1answer
36 views

Moving Rect with KEYDOWN

I tried to move my obstacle with the event type KEYDOWN, but it seems it is not working. This is my code. ...
1
vote
1answer
569 views

Unity: Move Collider up stairs/ramps

The bots have a simple Capsule collider which cannot tilt. Movement is applied across the horizontal axes, gravity is enabled on the rigidbody. It moves up stairs okay with steps roughly 0.2 units ...
0
votes
2answers
66 views

How to increase points per second when speed increases

I am making an endless rider game that is crossed between tron legacy and cube field. I am trying to add a point system were the faster you go the more points you get because you are more likely to ...
0
votes
0answers
30 views

Unable to use a velocity value when using KeyInput

Heres the code for the KeyInput ...
0
votes
1answer
319 views

LibGdx Positioning the camera

I've been following some tutorials about libGdx and I've tried to create a 2d platformer but I've got stuck at how would be the right way to make the camera not go out of the screen when the player ...
3
votes
1answer
1k views

How can I move a vehicle using speed and steering angle?

I want to drive a vehicle in x and y coordinate area with range from (0,0) to (6000,5000). I am using Visual Components (using Python API). On input I have speed data and steering angle of wheels ...
1
vote
0answers
19 views

What is the better form of movement for a vehicle that the player is inside of?

I am using unreal engine 4 to make this. Basically I have a submarine that the player can move around in and can control the submarines movement within an ocean. However I don't know the best way to ...
0
votes
0answers
37 views

How to check public bool of different script in C# - Unity [duplicate]

I seem to have some trouble with a problem that I feel should be really simple, but I've been beating my head against this for a few hours and I can't seem to figure out what the hurtle is. What I'm ...
0
votes
0answers
17 views

Unity with move gameobject line renderer

I create DrawLine class, I want my character to follow the line I draw. How do I move my character on draw line renderer ? Thanks! ...
0
votes
1answer
285 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: ...
0
votes
1answer
54 views

Colliders slightly intersecting each other; any solution?

Consider this simple scene: In Unity, colliders slightly intersect each other. Typically, this isn't a problem. However, I want to make a custom character controller using a box collider and not a ...
0
votes
1answer
207 views

libgdx Player movment dungeon crawler

The player go's throe walls and stops when theres no wall. Code: ...
0
votes
1answer
380 views

3D player movement with Unity's new input system

So, I trying to get used to the new Unity input system. "Back in the days" I just got the Vertical/Horizontal axis, put them into a Vector3, multiplied them by a certain value and then moves the ...
0
votes
1answer
26 views

Ways to move a character in Unity

I am studying Unity, and so far I encountered three different ways to move a character. As far as I understand: Directly changing the transform - ignores both physics and colliders; Using a ...
1
vote
1answer
244 views

Character Movement - Canvas Character - Javascript

How do I change the arrowkey movement so that is based off of the click of the buttons instead? Cheers ...
1
vote
1answer
2k views

Change Pawn movement speed

I'm newbie in Unreal development and I don't know how to move my pawn faster. By the way, I'm using Unreal 4.16. I'm developing Pong game and I have this method to move the pawn: ...
1
vote
4answers
2k views

PYGAME: When I release two directional keys together the player keep moving

I did the code this way to avoid the player to stop if a press two directional keys together making the movement more smooth. It works well but when I release two keys or more together the player keep ...
0
votes
1answer
36 views

Double jump, without allowing two jumps after falling down a cliff

I created a script that allows the player to double jump, which works like a charm. The problem is if the player walks off a cliff, they will still be able to jump twice. But that isn't how double ...
5
votes
1answer
3k views

How to implement curved movement while tracking the appropriate angle?

I'm currently coding a 2D top-down car game which will be turn-based. And since it's turn-based, the cars won't be controlled directly (i.e. with a simple velocity vector that adjusts its angle when ...
0
votes
0answers
26 views

Change hero direction in place before movement on a grid based game in Unity

I've already implemented a grid based movement with all the necessary animations. Now I would like the make the hero face the direction of the input without moving first and move only if the input ...
21
votes
3answers
4k views

Non-integer speed values - is there a cleaner way to do this?

Often I will want to use a speed value such as 2.5 for moving my character in a pixel-based game. Collision detection will generally be more difficult if I do that, though. So I end up doing something ...
0
votes
2answers
87 views

Pushing an object left and right (gravitation towards center of a circle)

So this is the problem: I have an object pulled towards the center of a circle and I am unable to figure out how to move the object left and right depending on its rotation around the circle. I ...
0
votes
1answer
608 views

Unity Mobile project, button problem “CrossPlatformInputManager.GetButton” not working

Good afternoon, I have a problem with an input in my code: Before testing it on mobile I tried on PC and the code to make my player sprint was like this: ...

1
2 3 4 5
18