#Projectile Fire Direction
1 messages · Page 1 of 1 (latest)
are you making some sort of a super accurate turret?
oh wait, im abit dumb
just a gun
custom projectiles?
if so:
- put a vector3 component infront of the gun (buller will spawn there)
- make sure the vector3 component is placed accurately and looks where the gun looks and not a degree in other direction
- you spawn the bullet on the vector position and rotation + add velocity that looks where the vector3 component looks
vector3 component should be placed on a distance where the object physically cannot touch the gun when at that position
easiest way to get it to go the right rotation is just using grid with 15-30 degrees set in grid settings
Add Velocity?
set velocity is better in this case
there's no big difference but set velocity is more reliable sometimes
but why would you need a Vector component?
This is more logical to me but its not precise enough
mostly so its easier to see and set up
but gaze direction gets the vector at which player looks, not the gun
so vr players will shoot it to their forward even if gun looks to their right
same for screenies that are in 3rd person
get forward vector of trigger handle to make it shoot where the gun looks
I only need the screen First perfective Version
recroom automaticaly rotates stuff like handles and guns in a way that makes screenies shoot accurately while the gun shoots to the guns forward
technically possible but you have to look at projectile launcher part as abit separate object
make it rotate on its own and rotate it separatly from the gun
basically spawn the projectile in a position and set its velocity to vector [target pos - bullet pos]
how do i set the velocity of the projectile? Do you mean the speed multiplier?
set velocity chip
oh wait
this is rooms 2.0 projectile system right?
yep
I want to build the raycast version
speed is how fast projectile moves
direction is were it goes (set it to [target pos - bullet/origin pos])
other stuff is self explanatory
for raycast you first do a raycast, get a point where it hit an object, make a vector from bullet origin to that hit point (hit pos - origin pos), and set direction of the bullet to that
pos = position
origin = where you spawn a bullet
hit pos = one of output of raycast chip
i gtg so i wont be able to help for now