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  
silasfriedrich

Make a cube stop if it hits a collider.

Question

Hi everyone,

I have a scene where the player can move and rotate a cube by touch. So the player can touch anywhere one the screen and move the cube but I wanna make a collider where the cube can go through. What is the best way to do that?

Edited by silasfriedrich

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts


  • 0

Depends on what you understand by "stop", if you want to disable its movement completely you can disable physics for rigidbody by toggling isKinematic which Controls whether physics affects the rigidbody.

 

Please login or register to see this link.

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

Thanks its working now :YMPARTY:

I have an other question tough  ^_^  This script make GUI Buttons I have to press to activate the touch. But I want that I dont have to press the button. I tried use a void but its not working

Please login or register to see this code.

Share this post


Link to post
Share on other sites
  • 0

I don't have something to help out with this issue at the moment, but I want to point something out. You, silasfriedrich, are awesome. You may have not contributed much to the community in terms of sharing assets yet, but unlike a few other members, you are asking for help. Most other people are blatantly asking for people to write entire scripts for them.

You are good.

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

Thanks Joey R :lol: . I always try to ask a question that way that it not sounds like: do this for me.  It should say: can you helping me by this. ;)

Edited by silasfriedrich
  • Like 1

Share this post


Link to post
Share on other sites
  • 0

Post your entire script here, we usually need to look at the entire script for general errors like these.

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

I did get it work. :d/  I made 3 void start and puted in the first one move in the other pinch and in the last rotation.

 

Here is the finished script :

Please login or register to see this code. Edited by silasfriedrich

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