Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by unity_SPXc9aQ2L1Fs8A · Dec 28, 2018 at 05:12 PM · buttonanimatorvuforiaaugmented realitypress

AR Object Button ALMOST FINISHED!!! UNITY/VUFORIA

Hi, my name is David

I'm preparing a gift for a friend of mine that is an artist. I want to make an animated AR version of this painting. alt text

I already made the 3d version and It works in Ar -also with animation-. But I want to animate it from plate to 3D with a Button to click (in this case the triangle in the chest).

alt text

I tried to use the following script of @jacksonbarnes but i'm not too good (Just start with unity/vuforia) and I miss a step. Please someone can Help Me?

  using System.Collections;
     using System.Collections.Generic;
     using UnityEngine;
     using UnityEngine.Events;
 
  public class WebsiteButton : MonoBehaviour {
 
  public GameObject definedButton;
  public UnityEvent OnClick = new UnityEvent();
 
  // Use this for initialization
  void Start () {
      definedButton = this.gameObject;
  }
  
  // Update is called once per frame
  void Update () {
      var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
      RaycastHit Hit;
      
      if (Input.GetMouseButtonDown(0))
      {
          if (Physics.Raycast(ray, out Hit) && Hit.collider.gameObject == gameObject)
          {
              Debug.Log("Button Clicked");
              OnClick.Invoke();
          }
      }    
  }

}


Thanks in advice,

best regards

D.D.

schermata-2018-12-28-alle-202145.png (446.3 kB)
schermata-2018-12-28-alle-201800.png (463.4 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Mentaner · Dec 28, 2018 at 11:36 PM

What is it you want to do exacly? Do you just try to activate something when the triangle is pressed ? If that is the case: Have you tried the OnClick method. That should work since touches get registret as clicks.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image unity_SPXc9aQ2L1Fs8A · Dec 29, 2018 at 06:25 AM 0
Share

I want to make a 3D OBJECT (the triangle in the middle of the chest) as button. When it is pressed It has to activate the animation of all the paint (See second picture in my question). It's difficult to find out the right code because I want the animation of the painting but also of the button. I don't want a static-flat button.

THEN: 1 Press the 3D button 2 the button move back (as a button should do) 3 all the paint comes up after this command. (It start the real animation)

P.S. I've already seen a lot of tutorial and forum discussion. The only code close to what I want It's the one i pasted in my question. Other tutorials are too old (and I don't know how to update for the new unity/vuforia versions)

Hope It's clear this time.

avatar image
0

Answer by unity_SPXc9aQ2L1Fs8A · Jan 03, 2019 at 01:20 PM

@aldonaletto Please can you check this question?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

141 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to hide this if button click 1 Answer

The archive is invalid. /var/folders/_k/9jd5s_9d1h59l72f3bfs018r0000gn/T/XCodeDistPipeline.9UU/Unity-iPhone.ipa does not exist 2 Answers

Using a wireless camera with iPhone/Android 0 Answers

Error with URL video for AR 0 Answers

Increment a loop iteration on button press? 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges