Ignore the fact i customised the look of my game becuase im going to talk about that more in a later post.
- create a new empty game object , call it bolt and reset it to origin
- create a quad to hold the image, call it vfx and move to origin, make this a child of the game object bolt
- make the trasformation of the quad x 90
- select materials folder, create new material, re name it blot orange , select material from asset picker
- drag material onto quad, change the material shader to particles additive to remove the black
- add a physics ridigid body to the bolt, turn off gravity, then a capsule collider and resize to the shape of the bolt, select is trigger
Add this code
save, check for errors
drag bot into pre fabs
in prefab select bolt, make speed 15
delete bolt from hierarchy
select player , open player control script , add this code
save it and go back to unity
create a new empty game object and child it to the play , name it ShotSpawn
position the shot spawn to where you want the bolt to be fired from
click on player
go to player control script in inspector
add bolt prefab on to shot
add the shot spawn to the shot spawn
and make the fire rate 0.25
save
No comments:
Post a Comment