Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
zeppeldep

camera going thru

Question

The plan is two make this available on PC only.
Use keyboard to control the helicopter, use mouse to orbit view about helicopter.
Problem: The camera is going thru the terrain, it will probably also go thru all meshes
Video here shows current nasty...
 
Please login or register to see this link.
 
Here is the scene showing the assets connected to the camera...
Please login or register to see this link.
 
 
Here is the code .. check the attempts I have made (very badly) ....
 
Please login or register to see this code.

Please help ...     : (

We will braai together when all this comes thru ..   : )

Edited by zeppeldep

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

if the camera collides with something

 

lerp camera in Z direction towards playerObject to minimum distance from playerObject (that way camera never goes through playerObject)

 

if camera is at minimum distance, lerp opacity of playerObject material to 30% (so player doesnt block view of environment)

 

if camera exits collision

 

lerp camera in Z direction away from playerObject to maximum distance from player

lerp playerObject material opacity to 100%

Share this post


Link to post
Share on other sites

  • 0

Thx!! Doh!!! almost have it now ... 'cept my lerp is wrong ... need to lerp to the target and not AT the target point ... how do I get a point between the current position and the target?

Please login or register to see this code.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...