Bullet spawning at high Player speed
Hey, when I spawn a bullet like this
GameObject gb = (GameObject)Instantiate(GatlingBullet, Mussle.transform.position, Mussle.transform.rotation);
at high speed (from an aircraft) the bullets seem to be awfully delayed. This problem becomes the most visible when shooting while moving sideways. It almost seems like they are spawning at the wrong position meaning from a position some milliseconds ago.
Here is also the bullet script if you need it:
transform.Translate(Vector3.forward * speed * Time.deltaTime, Space.Self);
Thank you for your help! :)
That is to be expected. If you want to counteract, you have to calculate the aircraft's future position (easy since you have it's movement vector), and instantiate at that point ins$$anonymous$$d.
i'm not clear on how to calculate the future position. what causes the delay and how can i anticipate this delay.
Answer by Kalumo · Nov 18, 2015 at 03:00 AM
Solved it. I reworked the initial way the aircraft moves with rigidbody.velocity. What i do then is let the bullet inherit this velocity and add the bullet velocity to this. Done.
Your answer
Follow this Question
Related Questions
Forge-like in game editor 0 Answers
Pick Up Rigidbody with mouse 0 Answers
Teleporting To Projectile Location 1 Answer
A fast question about player physics (Unity 5, C#) 0 Answers