A group member has done some idea on the staff shooting animation and death animation.
So to start off with shooting, I made a script which for now shoots a raycast and a effect of a magic ball which comes out of the firepoint (which is a child of the staff).
At first when I only had the raycast working, I made it so it will shooting at the place where your mouse is pointing at when press left click on the moue. I had a very annoying problem at the start when I tried to test it out where it wouldn't displace the raycast at the point where I wanted to click, instead it would fire off in the opposite direction or a complete random set point.
In the end I did fix it by remaking the game, and using exactly the same script so in concluded it was just unity being buggy.
After fixing the problem, I wanted to do the visual effect of a magic ball/bast coming out of the staff instead of the raycast. So after getting the effect from the shooting magic animation from before, I then made a new Material in Unity and named it Weapon Trail changed the setting to particle and additive and put the texture on.
After that I made a new object and called it Weapon Trailand put a Lin Renderer on it which will display our material we had made.
I also made anew script called MoveTrail which just simple makes the effect travel to where we click and attached it to the Weapon Trail.
After that and doing some more code on the script which shoots the raycast, I then had to made the Weapon Trail a prefab and made it spawn the magic ball effect out of the staff when I left click and travel to where I have clicked. Then I had a slight problem where the effect would only shoot upwards which was then fixed later on.
At this point we scrap the idea of shooting the magic ball by playing a animations and would take away some freedom of where the player wants to shoot.
Although nothing dies from it yet :(
No comments:
Post a Comment