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

Is it possible to move a Rigidbody without using force? #92

Open
mathiasdeoliveira opened this issue Nov 14, 2019 · 1 comment
Open

Comments

@mathiasdeoliveira
Copy link

Hello,

I'm a beginner with this lib.

Currently I can move my rigidbody with a force, the problem is that the object in question is a player so when the user releases the key, the player keeps moving forward.

I tried to move my mesh, and modify the position of my rigidbody according to it, I manage to get the contacts between my player and my obstacles except that with this method my player passes through my obstacles.

Is there anything in the lib that can solve my problem?

@icedcoke
Copy link

icedcoke commented Feb 9, 2020

你好,你可以用linearVelocity去设置物体的速度,这样可以保留物体的碰撞效果,同时停止的时候设置速度为零就可以了。在遇到问题可以查看下源代码,里面可以有想要的答案。
例如这样设置:
oimoBody.linearVelocity.set(0, 100, 0);

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

No branches or pull requests

2 participants