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
0
votes
1answer
77 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
49 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
27 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 ...
1
vote
1answer
109 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
87 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
121 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
25 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
86 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
180 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
21 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
253 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
50 views

Pushing Rigidbody forward doesn't go straight

I have a object that pushing rigidbody forward when it's instantiated: ...
1
vote
2answers
130 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: ...
1
vote
3answers
379 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
92 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
71 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
184 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
80 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
264 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
5k 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 ...
2
votes
2answers
2k 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
4k 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
40 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
87 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
702 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
203 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
581 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 ...
3
votes
0answers
60 views

why collision not detection not happened in Two Sphere

I start practice 3d collision detection of sphere in OpenGl containing two sphere one sphere hit using cannon gun but collision not detect when it hit and when i debug code collision statement triger ...
4
votes
1answer
234 views

How can I recreate the movement of arrow in air?

Given two Particles A and B which forms the arrow itself, A.P an edge of it and the opposite one B.P. Like so A.P---------B.P. const float DistArrow = 60; Where ...
0
votes
2answers
254 views

Best practice for RTS accuracy/aim

As I'm developing a RTS game set during the Napoleonic Campaign, I've got a question about the best method to implement 'bad aim' for the AI, as the accuracy of muskets were quite terrible back then. ...
4
votes
2answers
114 views

Scrolling background after firing projectile

I have a projectile which I fire using the mouse coords as the direction vector which I scale with a velocity vector and add a gravity vector to complete this simple simulation. I want to scroll the ...
1
vote
1answer
342 views

How to set rotation of a projectile in a parabolic arc in Box2D? [duplicate]

I have trouble making my projectile - in this case an arrow - rotate as it should when it's travelling in a parabolic arc. It doesn't rotate at all while travelling, only until it collides with ...
1
vote
1answer
445 views

Find Initial Velocity for Parabolic Arc with Fixed Angle that Crosses Target Position

In my game I want skeletons to occasionally lob bones at the player. The player can be anywhere in relation to the skeleton (above or below, to the left or right), and I want the skeletons to throw a ...
2
votes
1answer
598 views

finding the angle to launch a projectile at a 3d coordinates

I have a game where the user can shoot a bullet and the bullet flies through 3 dimensional space and eventually hits the ground somewhere. My question is how can I calculate the ...
1
vote
1answer
467 views

How to calculate the ideal hit of arrow?

I am trying to make the AI shoot an arrow and always hit the target. Assuming that the target is within his range I am stuck what the correct way is to do this. I search and found some solutions but ...
3
votes
1answer
2k views

How to create a projectile motion of a cannonball in top down view?

Objective To move the bullet with projectile motion to specific destination by touch point. In the below image is an example of a bullet which has a projectile motion. On my observation, the bullet ...
-1
votes
1answer
272 views

shooting the projectile in the way it is facing [duplicate]

I got my projectile facing the right way thanks to @S. Tarık Çetin. But now I want it to move the direction it's facing. I think I need to use RayCastHit2D but I am ...
0
votes
2answers
3k views

Projectile Direction Unity

I want to shoot a projectile in the direction the gun is facing. With my current script it only shoots vertically. (I can also make it go horizontally but that's it). This is my ...
2
votes
2answers
2k views

How to make Pong ai paddle?

I'm trying to make an ai so the paddles will move to position before the ball reaches it. I'm not sure how to go about it in this case. Here's the game http://cssdeck.com/labs/ping-pong-game-tutorial-...
3
votes
1answer
94 views

Accelerating Missile guidence

Background I'm building a simple game where two ships are launching missiles at each other in space. Stuff got complicated when the ships started moving in a frictionless environment and the ...
1
vote
2answers
468 views

Psudo 3D(2.5D?) Projectile motion

I'm trying to simulate a ball coming at the screen with a projectile motion arc in 2d space. Is there a set of equations to deal with this. I would imagine the equation would need to take in the ...
9
votes
2answers
580 views

Guided Missile with Constant Time

I'm building a game with players and missiles. I want to fire a missile from P1 to P2. The missile should always take exactly five seconds to reach P2. The missile should also track P2. If P2 moves ...
1
vote
1answer
1k views

Calculate initial velocity for trajectory given duration, launch angle, and distance

I need my entity to go from point A to point B with a given launch angle over a given time. I've been able to figure out the initial velocity without the constraint of the launch angle, but I can't ...
0
votes
1answer
462 views

Collision Between SKSpriteNode and SKShapeNode

Im trying to create a collision between to objects. one is a SKSpriteNode and the other is a SKShapenode. the Code I have so far for Contact is : func didBeginContact( contact: SKPhysicsContact) { ...
0
votes
1answer
124 views

How often should I calculate the position of a bullet?

In game's like Battlefield or Arma, how many times per second is the position of a bullet calculated?
-2
votes
1answer
2k views

Destroy object on Collision

I have a strange problem... I need a 2D projectile to destroy itself after colliding with an object. I have used all of the different ways to do this on the internet but to no avail; the object ...
1
vote
0answers
67 views

Rigidbody Projectile Being Suspended In Mid-Air

I am experiencing problems with Unity's Rigibody feature. Whenever I try firing a projectile, it gets suspended in mid-air. The projectiles are stored in an object pool. Below is the code and images ...
2
votes
2answers
1k views

Calculating initial velocities given trajectory parabola

I'm working on a volleyball game but my maths/physics knowledge isn't quite up to par. I need some help with the following problem: The player can hit the ball from anywhere on the left of the court ...
9
votes
3answers
3k views

How can I launch a GameObject at a target if I am given everything except for its launch angle?

I am trying to launch an object at a target, given its position, its target position, the launch speed, and the gravity. I am following this formula from Wikipedia: $$ \theta = arctan \bigg( \frac{v^...
1
vote
1answer
584 views

How to predict future position of an object(bullet sync)?

There is a multiplayer game and server sends to all clients a message when a shot happens, containing bullet position, bullet velocity and timestamp. By having timestamp, we can calculate the lag, let'...