Rays for Days at the pool
|
New Project and new things to learn. Over all i will be keeping these bloggs short. What i have been doing this week is to make movement script for a character in Unity(5.3.4f1). This Peculiar character will walk along walls and alls have the ability to pick up blocks and flip to a platform above it if it exist there. To make this happen i used ray casting in unity and in a total of five rays for this character. Two Downwards relative to the character that then get the surface normal of the underlying material. They then take this normal and average it from the two rays. Then we rotate the characters up normal vector to be equal to the surface normal. apply a little force in the opposite direction and we have a character that stays along the ground and rotated to the normal. Other rays ar for checking blocks that are Liftable. Also if their is a platform above close enough to flip to.
Another thing this week was the Water cube i added this is made of old premium assets that came whit unity. It dos not have any code for lifting other objects or Viscosity or the like but it looks pretty cool.
Thank you for reading this broken English. |
This is the character and he rays are temporary visible so it can be debugged.