Hey,
I’m having a bit of trouble with making my projectile move in a certain way. A bit of background on what I want this projectile do exactly will help with my problem I think, so what I want is a sort of fireworkesque effect. Currently I have a projectile that upon explosion spawns a bunch of other projectiles. These projectiles I want to move as if they have a rocket behind them, therefore always moving the direction it is facing. It may ricochet off walls or wobble in the air, but the projectile will always accelerate towards the way it is facing.
How would I get this to work exactly?
Attached is an image of one way I have tried to make this work. I have tried a variation of different ways along the lines of what is in the image to make it work, but none of them seem to be having any visible effect at all. I would go as far as to say that the script in its current form literally does nothing which is what I am confused about.
I also tried changing setting a new transform, however doing this not only teleported it into a weird location, but also didn’t have the desired effect I wanted with the potential for ricochets etc.
I have made the script simpler to just set the velocity on spawn and although the print string told me it set it, nothing happened.
As well as this, I made sure in the projectile movements that velocities were set to 0,0,0 by default at which point the projectile would refuse to move. I have tried a range of different things and I’ve concluded that either I’m missing something here, or the set velocity simply does not work
Any help would be greatly appreciated because atm I’m lost as to what to do because even the simplest of scripts for setting the velocity just are having zero effect on what is happening in-game.
Edit: Apparently stopping the simulation of physics on the mesh causes the projectile to go where it is told, however I want to simulate physics with gravity/ricochets. I don’t fully understand how simulating physics causes manually setting the velocity to not work.
I found that the desired effected I wanted was not possible in the way I was doing it as projectile movements and simulating physics aren’t compatible with each other.
This means scripting the physics behind it manually. For those that are curious, I did the ricochet of the projectile as shown in the attachment