Cocos Forums
2,359 FOLLOWERS
Cocos Creator is a unified package of game development tools. Their forum holds discussions on extensions, developer interviews, documentations, game demos, editor tools, collaborations and other generic announcements.
Cocos Forums
8h ago
OK. Anyway, you can directly modify linearvelocity after use applyImpulse to limit the speed of player, for example
private speed = v3();
private maxSpeed: number = 10;
protected fixSpeed(): void {
this.rigidbody.getLinearVelocity(this.speed);
if(this.speed.length() > this.maxSpeed){
console.log("fix speed");
let rate = this.maxSpeed / this.speed.length();
this.rigidbody.setLinearVelocity(this.speed.multiplyScalar(rate ..read more
Cocos Forums
8h ago
This is not entirely true, the player now instead moves sideways and on one axis ..read more
Cocos Forums
8h ago
Strange…Can you show us more information. Import and class declare part ..read more
Cocos Forums
8h ago
Why? If you set right speed, then player will walk in right direction ..read more
Cocos Forums
9h ago
error - Property ‘node’ does not exist on type ‘DebugViewRuntimeControl’.ts(2339)
I get the above error in Visual Code when opening a cocos project. This class does extend the component class. Node according to the documentation exists in the component class. I am using CocosCreator 3.8.2. How do I fix this ..read more
Cocos Forums
9h ago
This may work, but then the player will not walk in the direction of the camera ..read more
Cocos Forums
11h ago
It is possible. But you need read source code and do one more step for Android, I did it once but I lost my code ..read more
Cocos Forums
11h ago
applyImpulse make rigidbody have a speed instantly. So why not use setLinearVelocity to set is speed directly, It’s easier and more controllable ..read more