ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator The weapon goes through the wall
person icon
tsunasan
Registered User
Quote
2024-07-06 17:31:38

Hello. The first problem: I attached the weapon to the arm bone, but the weapon goes through the wall. Is there any way to fix this?
The second problem is with displaying the material on the weapon. The weapon is not visible on the fingers.

person icon
Guest
Guest
Quote
2024-07-06 19:46:33

Use this function from the docs to move the gun away from the wall: ccbGetCollisionPointOfWorldWithLine(). You can probably do the same thing with the Shoot action. I don't understand what you mean with your second problem.

person icon
Sloppy
Guest
Quote
2024-07-06 20:43:17

Just set your collider out of the bounds of the weapon..easy...

You can also reset the collider dynamically in various ways when you approach the wall....not hard

person icon
tsunasan
Registered User
Quote
2024-07-07 13:34:59

Guest wrote:
Use this function from the docs to move the gun away from the wall: ccbGetCollisionPointOfWorldWithLine(). You can probably do the same thing with the Shoot action. I don't understand what you mean with your second problem.

embedded external image
🔎︎


person icon
okeoke
Registered User
Quote
2024-07-07 14:04:39

I attached the weapon to the arm bone, but the weapon goes through the wall. Is there any way to fix this?


This happens due to a bug in CopperCube. FPS camera behavior has a property which is called something "disable clipping for child nodes" or similar. This setting allows all models attached to the camera stay on top of all other 3d models. The bug is that it only work for the direct children, i.e. your model node should be right under the camera node. Since in your case it's not a direct child, it's child of the joint arm bone, the behavior doesn't work as expected.

I believe you can fix it like:
1. Add a dummy node to you arm bone joint. Dummy node is a node without any geometry, i.e. create a sphere with 0 polygons and 0 radius. Set it to 0,0,0 position, so it's in the same exact place there your arm bone joint is
2. Place weapon under you camera node, so they are direct relatives.
3. Add a behavior, there you get dummy node position and rotation and apply it to the weapon node.

I never tried that, but I believe, it should work.

This issue probably also causes your second problem.

person icon
tsunasan
Registered User
Quote
2024-07-07 17:41:56


3. Add a behavior, there you get dummy node position and rotation and apply it to the weapon node.


Does this behavior need to be manually written in JavaScript? Or is it possible to customize the behavior without a script?

person icon
okeoke
Registered User
Quote
2024-07-07 18:20:45

Well, I tried it myself, and it doesn't really work. The idea was quite simple:
/*
<behavior jsname="behavior_AttachToDummy" description="Attach to dummy">
<property name="dummy" type="scenenode" default="" />
<property name="modelNode" type="scenenode" default="" />
</behavior>
*/

var behavior_AttachToDummy = function () {
};

behavior_AttachToDummy.prototype.onAnimate = function (node, timeMs) {
var pos = ccbGetSceneNodeProperty(this.dummy, 'Position');
var rot = ccbGetSceneNodeProperty(this.dummy, 'Rotation');

ccbSetSceneNodeProperty(this.modelNode, 'Position', pos);
ccbSetSceneNodeProperty(this.modelNode, 'Rotation', rot);
}


Unfortunately, both pos and rot are 0 vector here.
But I have another suggestion - you can try using JIS's 6.7 launcherhttps://vazahat.itch.io/coppercu....
Among the other issues it fixes:
-> Fixed a bug with the Disable Clipping option of FPS camera, previously it was disabling clipping for top-level children of FPS camera, now it handles


Launcher fixes this 100%.

person icon
tsunasan
Registered User
Quote
2024-07-08 13:38:21

Fixed a bug with the Disable Clipping option of FPS camera, previously it was disabling clipping for top-level children of FPS camera, now it handles

Launcher fixes this 100%.


I tried the Launcher and really now there are no errors. Thank you very much)


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |