Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having trouble moving projectiles from spline
#3
Thanks for responding, I want the projectiles(lasers) to follow the same spline the ship is attached to, but at the ships location and rotation. So follow the spline but offset from it like the ship is. the projectiles would appear to follow the curve of the tunnel, the same path the ship is on when it is first fired.

Ive included pics and scripts to, hopefeully, give you a full understanding of my problem. I had to start a new scene with only the basics of what im trying to do so I can better debug things. I have alot of other scripts and prefabs, etc, most will need rewritten most likely, but anyways, the first pic(https://www.dropbox.com/s/l3wl7x2mpedoi9k/curvyshippic.png?dl=0 ) will show the ship parented to a transform, parented to the transform with the aligntospline component attached. the ship rotates around the centerpoint using horzontal axis, while vertical moves forward, modifying the curvyspline.position on the spcenter gameobject.

The second picture(https://www.dropbox.com/s/vycw9b7wvhe8oln/curvyshippic1.png?dl=0 ) shows the projectile(laser) parented to the centerpoint that is parented to the point containing the aligntospline component. its a prefab and the parent will instantiate to the point specified in the ship script, gameobject "spcenter".

the third picture(https://www.dropbox.com/s/o9f6blt0x3cs3w0/curvyshippic3.png?dl=0 ) is another question I had Ive been wondering for a while. the texture seems to wrap around the tunnel, splitting in the middle, so the bottom and top of the texture dont line up and look bad. Im not sure if there is a way to fix this, im not sure if I used a custom model I made in blender and wrapped it in there or how it was made. Maybe theres a setting I can adjust.

The 2 scripts(https://www.dropbox.com/s/9iytxjd26eghjo1/unityscripts.txt?dl=0 ) I included are the only ones im using atm. I didnt edit it before sending it so there is alot commented out, but maybe that will help, and since im still new at c# and programming in general, it may seem a bit odd, but works for the most part. I left off adding spline.GetOrientationFast but I couldnt figure how to set it up or if its even what I want to use. I pretty much just do trial and error and learn as I go, lol. Im sure there is something that is wrong and could be written better. I hope you can find the issue or just see that im going about it completely wrong. Let me know if you need anything else and again, thanks alot.

 

 
Reply


Messages In This Thread

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: