#so yea idk what to do
1 messages · Page 1 of 1 (latest)
it does yea
Try to increase it ?
I cannot help you anymore, I have thing to do sorry. Add Debug.Log, try to use Transform.Translate instead could be potential things that you can try.
why can no one help me :((
i placed it on update
make prefab bro
oki
just place it at your gun barrel
you can create empty gameobject at your gun
try align it at your gun
wait a bit
did your gun has collider?
my gun has a collider yea
that is why your object destroyed
put Destroy(gameObject);
to if (health != null) { // Deal damage to the object health.TakeDamage(damage); }
you can also do this
if (collision.gameObject.GetComponent<Health>() == null) return;
// Check if the bullet collides with an object with a health component
Health health = collision.gameObject.GetComponent<Health>();
// Deal damage to the object
health.TakeDamage(damage);
// Destroy the bullet upon collision with any object
Destroy(gameObject);
it will
okay now it drops to the floor progress
nice
btw i call this whenever gun is shooting tho
well your previous scripts is alright
use this your bullet velocity will decrease over time
you can change forcemode
like this
my laptop isnt so gud so i just open note XD
so yea xd
gunBarrel is vector3 xd
just gunBarrel.transform.forward
still does nothing xd
still gives error
hmm weird
mhm
i mean transform
this is what i have now
[SerializeField] private Transform gunBarrel;
what xd
this is it noq
now
we are getting closer
i somehow fixed it
but now the bullet legit still does nothing
xd
so you are new in unity eh
bulletSpeed is your speed
public float speed
Gun Script - https://pastebin.com/Y4DtY5z2
MoveBullet Script - https://pastebin.com/a3PpXHyK
Health Script - https://pastebin.com/w3FPNimE
If you enjoyed this video make sure you get subscribed and leave any questions you have in the comments.
hey try this