Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having trouble moving projectiles from spline
#1
Hi, I am having trouble getting projectiles to fire correctly from a ship that follows one spline and is offset from it on the z axis. I need to have the projectiles fire from the ship and stay aligned to the spline as it moves forwards. So I have placed an alignToSpline component on a point that is attached at the spline and have an empty object child at 0,0,0 with a ship parented to that point, offset from it. I have controls set up to move the ship forwards and backwards using alignToSpline.position. I have the empty gameobject use rotatearound to move the ship around the tunnel. Everything moves just fine. I have a projectile setup kind of the same, with a center point, empty game object and a projectile parented to the object. I have to instantiate the projectile by using instantiate(projectile) without position or rotation since it just snaps to the center and doesnt work. Im having trouble firing the projectile from the ships position, so far i can fire it from its poition but not its rotation. Ive tried a few diffrent things and still having trouble.

Ive been working on this for way longer then I should and only have headaches and wasted time. I can't imagine it should be this hard to do, it seems ive tried everything and am still stuck with little progress on the game. Im hoping you can point me in the right direction, Ive been putting off asking for help since i think I would have a hard time explaining it and having to write alot to do so, but im at the end and ready to give up. Since ive found curvy, Ive saved alot of time and headaches by creating a spline I was trying to make without it and wasnt doing so good. Im hoping to get all this working and finally get the bulk of it done. Please let me know what you think I should do, thanks!
 
Reply


Messages In This Thread
Having trouble moving projectiles from spline - by static2601 - 02-01-2015, 02:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 14 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: