Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
walking "through" NPCs

therickman
Registered User
Quote
2018-05-18 18:41:03

Hello ,
I have tried to add NPCs ( non playing characters) to my scene and used the included sleepwalker and animated man.

First , I notice that my player ( it's a third person view) goes through these characters , as if they were transparent , even if I set them to "collide when moved"

I set one NPC to :
-stand still
-have a "game actor behaviour

The other one :
-walk along a path
-game actor

In either case , my player just goes through them...
Maybe I missed a parameter , can you help me please ?


fraktal
Registered User
Quote
2018-05-18 20:53:55

Hey. I think you also need to enable physics engine in order for it to work. (that is the only non-programming way i know , someone can correct me.

In the Publishing settings, you set Physics Engine to: Physics Simulation

and this should make it work, so you can make NPCs collision box collide with your players collision box. (make sure to position the collision spheres so they fit the characters, and that they are set to "collide when moved").


wild-master
Registered User
Quote
2018-05-18 22:03:58

You can try a method that doesn't require the "Physics Simulation" feature.

You must create an invisible static mesh around each character.

I created this CCB file as an example for you:
https://drive.google.com/file/d/...

When you load that file, you will see the "animated sleepwalker" and the "animated man". An invisible cube is attached to each of them as a child node. Each character is inside of its cube.

Try this:
1. Open the CCB file.
2. Press the Publish button to test it.
3. Then, use the WASD keys to move the first character, and the arrow keys to move the second character. The characters will collide like normal humans instead of walking through each other.

Play with the size of the collision boxes until you're happy with the points of detection, but remember this: The boundary of the "Collide When Moved" Behavior of each character must NOT exceed the boundary of the invisible box. Resize and reposition the "Collide When Moved" shape until it's fully within the dimensions of the invisible box. To make the boxes visible so you can modify them easily, go to the "Materials" pane of "cubeMesh1" and "cubeMesh2" and switch their Lighting settings from "Dynamic" to "Static (lightmaps)", and switch the other option from "Transparent (add)" to "Solid".


therickman
Registered User
Quote
2018-05-19 06:47:04

To Fraktal and wild-master : thanks a lot for your answers !
Special thanks to wild-master for taking the time to create an example !
I think it will be useful to many other beginners like me.

The example works great.

If you ever need beta testers for your project , or help with translation work ( I'm French ) , you can ask me, no problem !


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inter?ational" (you are not logged in)


Text:

 

  

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


   






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