Questions tagged [projectile-physics]

The motion physics of the objects sailing through the air, ranging from thrown baseballs to battleship cannonfire to falling rocks.

Filter by
Sorted by
Tagged with
1
vote
0answers
21 views

How to make a catapult work with physics and colliders?

This should be my final question regarding getting a catapult to throw something in unity. On my last question, someone suggested starting with something simpler (which I apologize for not doing ...
0
votes
0answers
17 views

Colliders stop working when they move [duplicate]

I'm trying to make a game where you play basketball as a catapult. Obviously an idea like this leans heavily on the unity physics engine. The cup of the catapult has a bucket on it to keep the ball ...
1
vote
4answers
125 views

When an object is launched off-screen, is there any way to know if it's coming back?

In this scene, the object becomes invisible and then comes back In this scene, the object becomes invisible but does not come back Is there any way I can tell if an object will come back when it ...
0
votes
1answer
50 views

Best practice for play location of projectile sound effects?

I am encountering an issue where I have a bullet that is destroyed on impact which is cutting off my bullet impact sound effect due to the audio source being destroyed. I like the idea of the sounds ...
0
votes
0answers
36 views

Trying to create a '2D 8 Ball Pool' game - Trajectory Prediction

I am trying to create a game similar to (Pocket Run Pool) https://www.youtube.com/watch?v=ewlAE6NQnsI&t=215s a 2D pool game that is much simpler than a 3D one I need help with creating code for ...
0
votes
0answers
24 views

Calculate hockey puck bouncing off rubber bumper

I am very new to game development (or any type of development for that matter) and I am trying to figure out how I would calculate a hockey type puck bouncing off a rubber bumper placed at a 45 degree ...
3
votes
2answers
76 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
52 views

The farther I move my character, the more its projectiles fire in the wrong direction

I'm making a top down shooter, and the movement is working fine. However, I'm having trouble getting my Fire function to work correctly. When I run the game, it kind of fires in the right direction, ...
0
votes
0answers
19 views

Strange momentum on projectiles shot out of “parent” object

I'm trying to shoot a projectile out of a moving "parent" object. Both objects move off of rigidbody physics, so I'm using addforce for the projectile. Whenever I move the "parent" ...
2
votes
1answer
115 views

How to calculate trajectory on a planet with drag factor

I'm curious what is the valid calculation of a projectile trajectory in case when: surface is not flat but spherical like a planet drag is enabled (for example 0.1) and we are in 3D I've found ...
2
votes
1answer
86 views

Find projectile initial velocity, and air time, given projectile elevation, distance, angle

I have a target X position (D). I have a turret Y elevation (E). Turret is always pointed at 45 degrees (A). I need to calculate the initial projectile velocity required to hit the target, with an ...
2
votes
2answers
89 views

How to predict where the soccer ball should be intercepted by an AI player after being kicked?

This question has been asked many times before, but most of the answers give solution to the problem where ball (target) is assumed to be moving at a constant velocity. In my scenario, I'm making a ...
0
votes
1answer
123 views

How to create a projectile path in unity using physics

I want to create a jump function that launches a RigidBody2D along a low, long, trajectory. In the following examples, I have set the linear and angular drag to 0, to eliminate any possibility of ...
0
votes
0answers
217 views

Optimize spawn & destroy? (Unreal Engine)

I'd really like to know how you'd go about optimizing this? 20 actors each spawning 8 projectiles per 0.1 sec which are then destroyed 0.8 seconds later, all done through blueprints Gif: https://gyazo....
0
votes
1answer
113 views

My bullets won't bounce in Unity?

I wanted bullets to bounce when they hit walls. However when colliding with a wall, they just jitter about on them. I didn't want to create a new physics material as I want to keep the ball moving at ...
0
votes
0answers
22 views

How do I calculate the required force to launch an object? [duplicate]

I want to use a rigidbody AddForce() method on an object to launch it over from the enemy to the player, like throwing a ball at a target. The problem is, I'm not ...
0
votes
1answer
35 views

Rotating projectile in direction it is moving

I am using a parabola curve to launch my arrows: ...
0
votes
1answer
54 views

OnTriggerEnter works…sometimes

I was working on a small game in which you shoot projectiles towards various targets, now I decide to use OnTriggerEnter instead of OnCollisionEnter because OnCollisionEnter adds a slight force to the ...
1
vote
1answer
50 views

Apply impulse in direction line is pointing with force proportional to the length of line

I have a line perpetually pointed at the mouse and originating at the player, but the length is limited to a certain value. I also can create a circular object on demand in Box2D (specifically the ...
0
votes
1answer
39 views

How can velocity be normalized after a collision if a projectile needs to maintain its height?

I want a thrown disc to travel along the same height, even after collisions. The problem is, there's an edge case that I'm not sure how to deal with. The lowest-tech solution would probably be to ...
0
votes
1answer
346 views

Emulating 3d trajectory in top-down 2d game?

As the title suggests, I am wondering if it's possible to emulate a 3d arrow trajectory to a top-down 2d game? If you would look at this clip of Age of Empires 2 game, especially when archers are ...
0
votes
1answer
72 views

AddForce results in stuttering movement

I'm currently developing a simple breakout/arkanoid mobile game. Now, I noticed that my ball movement is noticably stuttering. I've read various approaches about how to make the ball move and decided ...
0
votes
1answer
79 views

How do I account for the velocity difference between a ship and it's fired projectile?

In my project, I have a ship that moves and increases it's movement speed with respect to time and how long the acceleration button is being pushed(just like the way a real life car works), now as ...
0
votes
1answer
114 views

Shoot projectile same direction weapon faces

I want to be able to shoot a projectile from a weapon mounted on a vehicle. Right now I am able to do it but only in front of the vehicle. I managed to rotate the weapon to the direction the mouse is ...
1
vote
0answers
54 views

How to vary the initial velocity of a jump based on hold time?

What I want to do is, the longer player holds the screen, the longer distance the object will jump when they release the hold. Here is my code: ...
1
vote
1answer
53 views

Find the direction a Projectile should be fired from a Moving Object to hit another moving Object?

I am trying to do a simple AI Controller, which fires Missiles at the surrounding targets in the Scene. The AI Controller can fire projectiles when moving or stationary. The Targets are either ...
0
votes
1answer
1k views

How to make a smooth projectile in roblox?

I am trying to make a projectile (Energy ball) for my game. I am using body velocities, but the issue is is that it seems laggy. I shoot it then half a second through flight it seems to stop in mid ...
0
votes
1answer
244 views

What is a “Projectile”?

I don't know what a Projectile os. I'm not sure whether a Projectile is a spawn point which spawn a number of object or a number of multiple objects. I'm referring to this website. How do I use ...
1
vote
2answers
274 views

How do I launch a ballistic projectile to hit a moving target, given: launch position & angle, target position & velocity?

This problem is in 3D space. My question is: How do you find the initial velocity of a projectile that flies under constant gravity, so that it hits a target moving with constant velocity, given the ...
0
votes
0answers
30 views

Why is not the projectile going toward the target?

I have a project where I can shoot (with a simple projectile). Character Blueprint (generate projectile): However I would like to be able to make the projectile go towards a specific target. ...
0
votes
1answer
184 views

help with shooting projectile along a curve path

so i been trying to find a way to shoot projectiles along a curve path . and i found this tutorial on youtube which was really good. i also uploaded the project in case you wanted to check it out. ...
1
vote
1answer
829 views

Draw trajectory arc predictor in game

I found this tutorial on youtube and it works pretty well, but I want to add more to it. How can I draw a smooth arc path in the game view (right now the path is only visible in the editor)? Here ...
0
votes
1answer
31 views

Bullet Projectile Verticle Rotation

I'm very new to C# and Unity, and have been working on a projectile based weapon, and for the most part it's been working well. However, although the bullet fires facing the direction it's being shot ...
3
votes
3answers
1k views

Javelin throw projectile motion

I am trying to simulate throw of javelin using projectile motion. The basic physics of projectile motion of a point was used to position the javelin. For the rotation part, I just assumed that the ...
0
votes
2answers
110 views

Pushing Rigidbody forward doesn't go straight

I have a object that pushing rigidbody forward when it's instantiated: ...
1
vote
2answers
287 views

how to calculate initial Y velocity required to reach target?

I am trying to calculate the y velocity necessary for my player character to jump up and reach a y position within 1 second. Given that my game engine is at 60fps, I am doing: ...
2
votes
3answers
704 views

how to predict where a ball will land?

For a game of table tennis, the goal is that when the player hits the ball, the opponent (the computer) will move to the position where the ball will land in order to hit it back to the player. Said ...
1
vote
0answers
126 views

Projectile initial motion to hit a target position

I'm working on a 3D game where i need to shoot a projectile (arrow) in order to hit a target position. The projectile has an origin position and a motion vector v(t) where "t" is a time unit. v(t) ...
2
votes
2answers
73 views

Applied force is backward instead of forward when shooting an object

I have this FPS I'm making and I wanted to apply force to objects I shoot at however when I shoot on them, instead of going away from the camera they come towards it. I don't get it. I could fix the ...
1
vote
1answer
286 views

Projectiles in FPS games - OpenGL

I have some experience with Blender, but now I am using Xcode 9.2 and OpenGL 4.1 on MacBook Pro. I am also attending a couple of online courses on edX. I am developing (for fun and as an exercise) a ...
0
votes
1answer
92 views

How to randomly calculate the necessary velocity changes to reach a x,y,z target?

I am working on creating a mini vector graphics ping pong table, as described in this previous post: Trying to use 3D vectors for a 2D ping pong game Currently, the stage I am at, I am trying to make ...
1
vote
0answers
420 views

Unity - How to calculate max distance (range) of a Projectile taking drag into account?

I am able to calculate the projectile max distance, but it only works when there is no drag applied on the spherical projectile. I used the formula for range of a projectile as follows:- ...
1
vote
1answer
7k views

Shooting projectiles towards mouse position in Unity 2D

I'm currently creating a scrip that handles the projectile movement and it's almost where I want it to be. Currently the script correctly instantiates the projectiles, moves the projectiles towards ...
3
votes
2answers
3k views

Projectile Aim Prediction with Acceleration

I'm trying to solve the classic shoot moving object problem but with acceleration attached to that changes it from a quadratic to quartic formula but my math skills are not this good sadly as i prefer ...
1
vote
1answer
7k views

Rifle bullets/projectiles in Unity, raycasting or rigidbody?

Hello again gamedevers :) I'm trying to create a fairly simple FPS shooter game. Im using a Rigidbody FPS Controller prefab from ...
0
votes
1answer
43 views

How can I reference the frontmost part of a mesh in my Unity code? (and help making FPS projectiles seem more real)

I have started making a PC game using Unity. It's just a test project, where I'm making as basic as possible FPS shooter. I'm using the FPS Controller prefab, and I have also a rifle model attached ...
0
votes
1answer
92 views

Firing a simple sphere from below the camera at crosshair in the centre of the screen, with or without raycast

I have a game that spawns "enemies" within a sphere around the camera, the player moves the camera to target and simply presses the screen to fire. For now my "ammo" is simply a sphere and for visual ...
0
votes
1answer
1k views

Required initial velocity (fixed launch angle) for projectile to hit a target

The scenario: I have an enemy tank (AI) chasing my friendly tank (player). When the enemy gets close enough he tries to shoot the player. Now the enemy prefab has an empty game object attached as a ...
0
votes
0answers
232 views

Getting launch angle for projectile given height, distance and speed in 3D [duplicate]

EDIT: This is not a duplicate as the proposed solution does not seem to work. See the bottom of this question for clarification. I am trying to calculate the launch velocity of a ball that needs to ...
5
votes
3answers
814 views

Why aren't game bullets implemented as if they were real bullets?

Let's say I'm working on a 3D first-person shooter and the boss is a stickler for realism, and orders me to implement the bullets as tiny projectiles that travel, say, 1000 meters per second. What ...