Hi there!
I have a prop gameobject “Spring” with a box collider set to triger.
So, whenever player jumps over the spring, he gets lifted in the direction the spring is facing.
You can have the images for the mechanics of the props.
The above image shows the first mechanic. Player jumps over the spring, and he gets thrown upward.
Note: This upward direction is what I want. That is, the spring can be rotated in like left, right, up, and down direction.
I want the spring to throw the player in the direction it is facing the arrow. And, yeah, it includes diagonal push or throw. The picture below shows just that!
Now, I am not saying I can’t do this simple problem.
I do have a solution to the problem i.e. The player already has character controller attached to it. Now, When player jumps on the trigger, the spring will add jumpSpeed to the playerController Script that controls the Charactercontroller.
Easily said, right?? That solution is for upward direction. But I also want downward, left, right, diagonal, etc. And, that through the character controller is hell!!
Complexity will rise when I tell that the Enemy AI can also use this spring. Now complexity goes sky high.
I was thinking the solution to be a better one. All I want is that the Spring applies a force or velocity on the Enemy or the player in the direction I specify it through vector3 mostly.
So, force should be able to do that, right??
Thing is, I do not know that!!!
So, any suggestions guyz!
Note: Game is being developed under Unity 3.5.7f6 Windows for Android.
Thank you for your support!!