Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double clicking GameObject looks at object #15

Merged
merged 2 commits into from
Apr 18, 2022
Merged

Conversation

JamesTKhan
Copy link
Owner

@JamesTKhan JamesTKhan commented Apr 17, 2022

Adds a double click action on game objects within the scene tree. When double (left) clicked the camera will look at that object. If its more than a certain distance away camera will do a basic lerp towards the target as well. Functionality is limited for now but may make it smarter about object size down the line.

doubleclick

if (tapCount != 2)
return

val node = tree.getNodeAt(y)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use val go = tree.getNodeAt(y)?.value; and you can remove the next if statement.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that worked, cleaned it up a bit

@JamesTKhan JamesTKhan merged commit 7e03e32 into master Apr 18, 2022
@JamesTKhan JamesTKhan deleted the look_at_selection branch May 10, 2022 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants