Skip to content

请问透视投影下人物移动到鼠标右键点击位置该如何实现 #19

Answered by singlecoder
zhhbinn asked this question in Engine
Discussion options

You must be logged in to vote

大致思路如下:
1、添加一个全屏的碰撞体,参考文档:https://oasisengine.cn/0.8/docs/input-cn
2、在 onPointerDown 里面通过光标按键检测判断是否点击以及当点点击坐标,此坐标为屏幕坐标,并将此坐标转换为世界坐标,参考示例:https://oasisengine.cn/0.8/docs/input-cn#%E5%85%89%E6%A0%87%E6%8C%89%E9%94%AE%E6%A3%80%E6%B5%8B
3、第 2 步拿到了世界坐标,人物移动就是自己的业务逻辑了

Replies: 0 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by singlecoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Engine
Labels
None yet
2 participants