Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
AshwinTheGammer

Bullet Tracer Problem

Question

I've problem with my bullet tracer. Whenever I shoot it doesn't go forward it goes either left or right. See the script for more:
 

Please login or register to see this code.

I could show you GIF and images but I don't have time now. If you need more info then do comment please.
That's all!

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts


  • 0
Please login or register to see this quote.

it didnt work! I couldnt I saw bullet tracer going forward, it goes back and sometimes left. I don't know where is ****' problem. 
is there any other idea to solve it?

Share this post


Link to post
Share on other sites
  • 0

Your not setting the rotation of the tracer. Thus the tracer is always facing in vector3.forward instead of in the same direction as the camera

Share this post


Link to post
Share on other sites
  • 0

I think you overcomplicated this in your head. Just a few things that doesn't make sense to me:

  • Why do you rotate the tracer spawn point?
  • What's the point of converting the direction from local to world space? (TransformDirection)

The tracer spawn point is attached to the gun or whatever it is right?

Then all you have to do is spawn the tracer at the position of the spawner with the same rotation as the spawner. Then apply forward force on the tracer.

 

This will spawn a tracer and launch it in the spawn point's forward direction (the blue arrow of the transform):

Please login or register to see this code.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...