How to Put point of interest in unity 3D [closed] - unity3d

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I made a wall in Home sweet 3d with some pictures on it and I imported it as a .obj and opened in unity 3d. I want to put a button next (point of interest) to every image So that on click to the button, a popup should appear with some text.

GameObject -> UI -> Button
create a button and move it in your scene
change the sprite to whatever you want it to look like
attach a script to an object in the scene with a method to show your popup
add the method to your button's onclick

Related

I cant drag sprites into the animation window in unity [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 months ago.
Improve this question
I want to create an animation, but when I drag my sprites(Flat images) in the animation window, it doesn't allow me to drop them.
So, I can't make an animation, which is needed to make a game.
I am a noob, so forgive me if the answer is obvious.
The question is a little too vague, but what you will need to do to animate a sprite, you will need to first add it in your scene and then you will be able to animate them. If you're using sprite sheets however This official tutorial should help
Check if you have clicked on the game object that you want to create an animation yet.

Detect if face is within a circle [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Currently I am working on face detection app. I have implemented face detection part using Apple's Vision.
And app has custom white circle drawn over the screen (you can see in below image).
Now, how can I detect if face is within that custom white circle or not?
I have also done similar project for fun. Link here: https://github.com/sawin0/FaceDetection
For those who don't want to dive into repo.
I have quick suggestion for you, if you have path of circle and face as CGPath then you can compare circle's and face's bounding box using contains(_:using:transform:) .
Here is a code snippet
let circleBox = circleCGPath.boundingBox
let faceBox = faceRectanglePath.boundingBox
if(circleBox.contains(faceBox)){
print("face is inside the circle")
}else{
print("face is outside the circle")
}
I hope this helps you and others too.
P.S. If there is any better way to do this then please feel free to share.

cant get Image or Texture of UI.Image in Unity [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
m_Image = GetComponent<Image>();i am trying to put a list of images and whenever clicked i want to replace clicked image to a plain . as i am a beginner in unity please share your thoughts,,
As shown here the pen image should be replaced in the floor
I believe you should use
GetComponent<Image>().sprite
and set a sprite instead of an Image.
You should use Sprite instead of an image(sprite is a part of images components in unity)
GetComponent<Image>().sprite;
Read more about Sprites
Unity Manual

How do you code for a dual action card in Unity? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
We are coding a new card game for a customer who would like cards to have "double actions" like the following:
Deal +2 Damage to any Enemy Spaceship
OR
Restore any of your Spaceships to Full Health
Obviously we have Action 1 and Action 2 as separate parameters on the card itself, so that's not the problem. If you think of card games like Hearthstone where you are dragging and dropping cards onto the game area. How can the player inform the system which action they are playing?
You can do this in multiple ways. Probably the easiest one is to have List<YourBehaviour>or YourBehaviour[] in the card class and to pass the index of the behaviour that the player chose in the constructor and set your main behaviour like so
Card(... int behaviourIndex)
{
...
this.MainBehaviour = YourBehaviour[behaviourIndex];
}
Or have custom method in Card class like:
public void SetupMainBehaviour(int behaviourIndex)
{
this.MainBehaviour = YourBehaviour[behaviourIndex];
}
When it comes to Unity you can have some cool popup and with multiple choices

Generate a grid in Swift using Sprite Kit [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have an app idea so mocked it up in C# because that's my most fluent language. I now want to port this over to Swift if possible, how hard will it be to generate a grid of 6x6 blocks, each block needs to be separate from each other as I need to change they're properties and detect touches on them. This is the grid I've currently got running on Windows.
Thanks for any help.
There are a lot of different ways to approach this problem, so you need to provide more details. You could do it with a single custom UIView, drawing the current representation of your model in the drawRect method and it would also be able to handle all of the touch events since you can just calculate where the user did the touch in the same way that you calculated drawing the grid and coloring the squares.
But if you want to use SpriteKit, then this tutorial will show you all the details of doing a 2D array, using sprites, tiles, etc.
http://www.raywenderlich.com/75270/make-game-like-candy-crush-with-swift-tutorial-part-1