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  
giltine528

Dashing when looking at nothing?

Question

Hi, I havent programmed in a while, but I just wanted to do something fun atm. So first of all I wanted to create a dashing script, where the player when looked at certain object or empty space would dash to the location.

I think I got the, looking at the object dashing, part correctly. But how do I go with dashing when looking at nothing? Dashing also includes the y axis, so you can do it into the air like a ninja.

Here is the script:

Please login or register to see this code.

 

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 1

The best solution in my opinion is to turn off gravity and manipulate your movement vector for the rigid controller or char controller. The problem with your method is it uses lerp to directly modify the transforms position which doesn't account for collision between casting point and destination point so the player would "ghost" through corners of buildings or boxes, etc.

Share this post


Link to post
Share on other sites

  • 0

Just make the position the end of the ray if no object is hit. Not sure what the question is bc all the information is there, just not used

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

True, that worked heh, on the other note, is my method of dashing done correctly or there is a better way?

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...