stop certain objects moving?

So I have a character that walks around but when he collides into objects it moves the object as well, so is there a way so that my character stops or slides past the wall without the object that it’s moving into moving at all?
thanks.

Could you be a little bit more specific?

yep.

import direct.directbase.DirectStart
from direct.showbase.DirectObject import DirectObject
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import LerpFunc
from pandac.PandaModules import CollisionHandlerQueue, CollisionNode, CollisionSphere, CollisionTraverser, CollisionPolygon
from panda3d.core import Point3
import sys

class GoldenTowers(object,DirectObject):
        
    def __init__(self):
        self.winXhalf = base.win.getXSize()/2
        self.winYhalf = base.win.getYSize()/2
        self.smiley()
        self.frowney()
        self.man()
        
    def man(self):

        base.cTrav = CollisionTraverser()
        self.pusher = CollisionHandlerPusher()
        
        self.man = loader.loadModel('frowney')
        self.man.reparentTo(render)
        self.man.setPos(0,0,0)
        cNode = CollisionNode('man')
        cNode.addSolid(CollisionSphere(0,0,0,1.1))
        Cman = self.man.attachNewNode(cNode)

        base.camera.reparentTo(self.man)
        base.camera.setPos(0,0,0.5)
        base.camLens.setNearFar(1.1,1000)
        base.disableMouse()

        speed = 25
        Forward = Vec3(0,speed*2,0)
        Back = Vec3(0,-speed,0)
        Left = Vec3(-speed,0,0)
        Right = Vec3(speed,0,0)
        Stop = Vec3(0)
        self.walk = Stop
        self.strife = Stop
        taskMgr.add(self.move, 'move-task')

        # note: I copied this exactly from this link 'https://discourse.panda3d.org/t/my-fps-script-awsd-jumping-wall-sliding/3716/31
        self.accept( "escape",sys.exit )
        self.accept( "s" , self.__setattr__,["walk",Back] )
        self.accept( "w" , self.__setattr__,["walk",Forward])
        self.accept( "s-up" , self.__setattr__,["walk",Stop] )
        self.accept( "w-up" , self.__setattr__,["walk",Stop] )
        self.accept( "a" , self.__setattr__,["strife",Left])
        self.accept( "d" , self.__setattr__,["strife",Right] )
        self.accept( "a-up" , self.__setattr__,["strife",Stop] )
        self.accept( "d-up" , self.__setattr__,["strife",Stop] )
        
        self.pusher.addCollider(self.Csmiley, self.smiley, base.drive.node())
        base.cTrav.addCollider(self.Csmiley, self.pusher)
        
        self.pusher.addCollider(self.Cfrowney, self.frowney)
        base.cTrav.addCollider(self.Cfrowney, self.pusher)

        # move function. note: I copied this exactly from this link 'https://discourse.panda3d.org/t/my-fps-script-awsd-jumping-wall-sliding/3716/31
    def move(self,task):
        dt=globalClock.getDt()
        # mouse
        md = base.win.getPointer(0)
        x = md.getX()
        y = md.getY()
        if base.win.movePointer(0, self.winXhalf, self.winYhalf):
            self.man.setH(self.man, (x - self.winXhalf)*-0.1)
            base.camera.setP( clampScalar(-90,90, base.camera.getP() - (y - self.winYhalf)*0.1) )
        # move where the keys set it
        moveVec=(self.walk+self.strife)*dt # horizontal
        self.man.setFluidPos(self.man,moveVec)
           
        return task.cont

        # create 'smiley'
    def smiley(self):
        
        self.smiley = loader.loadModel('smiley')
        self.smiley.reparentTo(render)
        self.smiley.setPos(0,0,0)
        self.Cnode = CollisionNode('smiley')
        self.Cnode.addSolid(CollisionSphere(0,0,0,1.1))
        self.Csmiley = self.smiley.attachNewNode(self.Cnode)
        self.Csmiley.show()

        # create 'frowney'
    def frowney (self):
        
        self.frowney = loader.loadModel('frowney')
        self.frowney.reparentTo(render)
        self.frowney.setPos(5,25,0)
        self.frowney.setScale(2,2,2)
        self.Cnode = CollisionNode ('frowney')
        self.Cnode.addSolid(CollisionSphere(0,0,0,1.1))
        self.Cfrowney = self.frowney.attachNewNode(self.Cnode)
        self.Cfrowney.show()

GoldenTowers()
render.setShaderAuto()
run()

if you execute this code you will notice that when you run into ‘frowney’ or ‘smiley’ that they will move, so what I want is that ‘frowney’ and ‘smiley’ don’t move when I hit them and ‘man’ just slides past. (if that makes sense)

Which character moves when colliding?
The character you’re controlling? Or something else?

Both objects move (the one I’m controlling and smiley) and I want it so that smiley doesn’t move and when they collide man, (the one I’m controlling) just stops or slides past (like if it was a solid wall) with out smiley moving around as if man is pushing it.

Based on a quick look, I suspect that your problem is that you’re adding the “smiley” and “frowney” to your pusher.

As indicated in the manual, divide your objects into “from” objects and “into” objects: objects that cause collisions and objects that are collided with. Which are which depends, I daresay, on your situation (in general, I believe: attempt to reduce the number of “from” objects in order reduce the performance cost of collision), but in this case, since you want “man” to be pushed and “smiley” and “frowney” to be static, I recommend that “man” be a “from” object and “smiley” and “frowney” be “into” objects.

In short, don’t add either “smiley” or “frowney” to either your traverser or pusher, I believe.

For a more detailed explanation, take a look at this manual page.

Thanks you were absolutely right I just removed ‘frowney’ and ‘smiley’ and added ‘man’ and everything was fine.