Question by
BilalSaci · Apr 20 at 11:20 PM ·
instantiatefpsaddforce
Is there a way to code this diagonal force?
Quick and simple Q for those who know:
A projectile is being fired from a weapon (think: grenade launcher for planting trees).
Writing these two lines is just not working? If I remove the other, the other works fine, but they do not play nice together. How can I combine the Add Force lines in to one? Or at the very least make them work simultaneously.
p.AddForce(transform.forward * pSpeed, ForceMode.VelocityChange);
p.AddForce(transform.up * pSpeed, ForceMode.VelocityChange);
Thanks!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613055627im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Problem with instantiate and destroy multiple objects 0 Answers
Addforce is not working 1 Answer
FPS Raycasting vs Instantiate 0 Answers
[Unity2D] Firing bullets based on gun orientation 1 Answer
More problems with arrow shooting 0 Answers