D
D
destrix2021-04-06 23:37:01
Unity
destrix, 2021-04-06 23:37:01

How to make a bullet fly straight?

There is a player with a weapon and a top view. I want to make it so that when LMB is pressed in the player's place, a cube is created and flies in the direction where the player was looking. I practically implemented it, but when I spin the character, the cube's flight path also changes. Help. Screenshots of the code and screenshots from the video attached.606cc65c17a64123051888.png606cc66299e95452177428.png606cc669af610582656637.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
ZB Venom, 2021-04-07
@zb_venom

In FixedUpdate, uberic way.forward assignment (assuming the character's direction)
Assign it once in Start().

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question